Is it good practice to give each CouchDB user a separate database?

前端 未结 4 893
情话喂你
情话喂你 2021-02-15 00:39

I have a bit of conceptual question regarding the structure of users and their documents.

Is it a good practice to give each user within CouchDB their own databa

4条回答
  •  爱一瞬间的悲伤
    2021-02-15 01:16

    This is quite a common use case, especially in mobile environments, where the data for each user is synchronized to the device using one of the Android, iOS or JavaScript (pouchdb) libraries.

    So in concept, this is fine but I would still recommend testing thoroughly before going into production.

    Note that one downside of multiple databases is that you can't write queries that span multiple database. There are some workarounds though - for more information see Cloudant: Searching across databases.


    Update 17 March 2017:

    Please take a look at Cloudant Envoy for more information on this approach.

    Database-per-user is a common pattern with CouchDB when there is a requirement for each application user to have their own set of documents which can be synced (e.g. to a mobile device or browser). On the surface, this is a good solution - Cloudant handles a large number of databases within a single installation very well. However ...

    Source: https://github.com/cloudant-labs/envoy

提交回复
热议问题