apache / couchdb

Seamless multi-master syncing database with an intuitive HTTP/JSON API, designed for reliability
https://couchdb.apache.org/
Apache License 2.0
6.24k stars 1.03k forks source link

Multi-tenancy support #1539

Open wohali opened 6 years ago

wohali commented 6 years ago

Cloudant has this. Would be great if open source CouchDB had this too.

Depends on #1504 .

janl commented 6 years ago

I have a node.js based proxy prototype of this (closed source at the moment) that could help with inspiration. I might be able to share its test suite in the future.

manobi commented 5 years ago

I have used Couchdb in past as a secondary database in SaaS apps it was never my main storage. I'm not sure if I really need multi-tenancy builtin, because it would increase the docs complexity.

But I would love to see the proxy @janl mentioned, actually I'm planing to port an tenant handler we have from PHP to node.js and open source it (it's actually for mysql but I can create wrapper for other database).

Can you share something about the common strategies used? one database per tenant or all data in a single database and proxy controls what each tenant can see?

wohali commented 5 years ago

@manobi you may also want to look at the _access proposal for CouchDB 3.0, which helps with the latter scenario. I think this might be better for your situation, frankly. See #1524 for details.

manobi commented 5 years ago

@wohali Thanks for sharing, I will be following your recommendation.