Our application may have hundreds or thousands of tenants and all of our tenants are stored in the same bucket. We may have lots of Ad hoc queries and we are not able to create those indexes in advance, that’s why we would like to use the Couchbase Analytics feature. We have two proposals to model our data in Analytics:
- Create one single dataset based on the bucket
This means that the dataset will contain data for all the tenants.
- Create each dataset for each tenant
If we have thousands of tenants, we will have thousands of datasets.
All our queries will always be based on a given tenant and document type. I have the following questions:
- Will #2 have better query performance than #1?
- Will there be any issues with too many datasets in the system? Is there any limit on how many datasets we are allowed to have for each cluster?
- Since our application can query against the Analytics dataset, do you think we still need to use the regular Query service? What is the advantage of using the Query service instead of the Analytics service? If we only run query against the Analytics service, are there any potential issues?