The trap of choices
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.
Comments
I'd sum it up as 'manipulation basics' :P
It depends on who's talking to you. When a customer talks to me about technical options, I almost automatically look for the option that wasn't named.
I didn't expect that sort of behaviour from you, but now I am forewarned :)
Isn't this exactly what Julien's comment said?
"I would choose the first one, with the addition of a "default" database and the management of naming conflict for this default database (default db would not be allowed if it has documents which name correspond to the name of an other DB). That way, no breaking change."
Btw. your image link points to a PhotoBucket "bandwidth exceeded" page.
REST isn't about pretty URLs. All of the URLs you listed are equally RESTful. Please stop spreading this fallacy.
Frank,
I asked the exact same question in the ravendb mailing list...
Configurator,
I wasn't able to understand that from that comment, no
Comment preview