5

I'm planing on having my database stored in Cloudant.

Our application is multi-tenant. We currently do the separation to tenants based on a value in some of our tables which will naturally translation to value in a document. Another way is to have database per tenant. We currently have around 100 tenants and hopefully will grow to 500-2000 in our best projections.

What is the pros and cons between all tenants in one db vs. db per tenant?

Is there limitation on the number of database we can create and work with concurrently?

Ido Ran
  • 10,584
  • 17
  • 80
  • 143
  • What type of limitation are you referring to? Cloudant charges for usage. – WiredPrairie Aug 08 '13 at 12:04
  • My limitation I mean number of database to create under one account and number of database to work with concurrently. This is described here http://wiki.apache.org/couchdb/Performance#CouchDB_Configuration_Options – Ido Ran Aug 08 '13 at 12:17
  • It's a Cloudant issue, not a CouchDB issue. – WiredPrairie Aug 08 '13 at 13:26

1 Answers1

5

This is a good and involved question. There are pros and cons to both models. The main advantage to one large database is that you can analyze (search, mapreduce, etc) across all users very easily. The main advantage of one-db-per-user is that every user has their own data "sandbox", which may be nice for your SLA. Additionally, that means that the amount of data in each user database can be relatively small.

If you can provide more details about the data you are storing, the relational modeling, and the queries you hope to be able to do, I can probably give you a more satisfying answer.

Will Holley
  • 1,745
  • 10
  • 11
  • In our model each tenant can create it own surveys and conduct them, which means collecting answers for each survey. For one side it is vital that we ensure no data leaks between tenants. On the other hand, been able to create views the cross tenants is also very compelling, even for something as simple as how many answers we got each day. – Ido Ran Aug 08 '13 at 12:15
  • In that case, using one large database and adding the UID of each user to every document sounds like a good model. That does mean that you need to design your materialized views and application code (either server-side or client) accordingly. That's fairly standard practice in building 3-tier applications. That will then allow you to do business reporting/analytics for yourself across all customers. – Mike Miller Aug 08 '13 at 17:05