0
votes

This is more of a design question while integrating couchbase with elastic search plugin. I have used couchbase with multitenancy in our previous product and we followed the the very first suggestion we found on couchbase blog here Single Couchbase Bucket for All Tenants.

Now we are researching on exploiting elastic search features on couchbase data using the couchbase elastic search plugin. Going through the couchbase elastic search plugin documentation (installing and setup) I realized that you will be able to map only one couchbase bucket to one elasticsearch index. That documentation can be found here Elasticsearch plugin configuration and here Connecting to Cluster. Now in that case, just as couchbase bucket, all the documents (regardless of the tenant) will reside in the same index.

Now here's my question. Regardless of how the documents are stored in couchbase, I would like elasticsearch to index to be per tenant. I am still quite new to playing around with the integration between these 2 systems but I am assuming that having separate search index per tenant (and each tenant/index having many different types of it's own) can most definitely 1) increase search performance per tenant 2) the performance of a particular search query on a specific tenant that might have minimal sets of data will not be impacted by having huge sets of data for some other tenant on the same index (although not plausible, assuming that the data sets between tenants differ by a factor of 50x)

What I am wondering is, are my concerns valid. Will performance on search queries be impacted by having all the tenants indexed together? And if so, anyone has any solutions on how can achieve this using couchbase elastic search plugin ?

All help and thoughts appreciated !

1

1 Answers

1
votes

There's no simple way to separate the data that comes from a single Couchbase bucket to different ElasticSearch indexes when using the plugin. What you CAN do is give the different tentants different types in ElasticSearch, while still keeping them in the same index. This will both improve the search performance, and make the tentant management consistent between CB and ES.

To map different documents from CB to different ES types, use the type selector feature of the transport plugin, as described here: http://docs.couchbase.com/admin/elastic/adv-usage.html (Scroll down to the section named "Setting document type")