Originally posted at 11/29/2010
In a recent blog post, I presented two choices about how to access the RavenDB multi tenancy feature.
- /northwind/docs - breaking change, obvious, less work
- /docs?database=northwind - non breaking change, not so obvious, more work
That post received a respectable amount of attention, but the point of the post wasn’t so much to gather information, but to prove a point.
Out of the 14 comments that that post current have, exactly none have tried to explore the problem beyond the options offered in the post.
In the real world, I solved the problem with RavenDB multi tenancy in a way that is both backward compatible and RESTful. The syntax for the url is:
- /docs <- use the default database
- /databases/northwind/docs <- use the northwind database
That is a pretty big problem that you have to deal with when you are communicating. When outlining possible solutions to a problem, you have to be aware that in many cases you are closing off people’s minds to other alternatives, which may be preferred.