# Multi-tenacy

**URL:** <https://discuss.elastic.co/t/multi-tenacy/2863>\
**Category:** Elasticsearch\
**Created:** [March 24, 2010, 4:56pm UTC](https://discuss.elastic.co/t/multi-tenacy/2863 "2010-03-24T16:56:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_7](https://avatars.discourse-cdn.com/v4/letter/m/bcef8e/32.png) [@Michael\_7](https://discuss.elastic.co/u/Michael_7)\
**Post date:** [March 24, 2010, 4:56pm UTC](https://discuss.elastic.co/t/multi-tenacy/2863/1 "2010-03-24T16:56:27Z")

</div>

Hi,

I am considering using elastic search in a multi-tenant application,  
should I have any concerns using an index per customer? Will thousands  
of seperate indexes cause any problems? Other than those scaling can  
fix?

Also can I secure each index separately?

Any documentation/samples for multi-tenacy.

Best.

Mike

---

<div class="post-metadata">

**Author:** ![Berkay\_Mollamustafao](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@Berkay\_Mollamustafao](https://discuss.elastic.co/u/Berkay_Mollamustafao)\
**Post date:** [March 24, 2010, 5:47pm UTC](https://discuss.elastic.co/t/multi-tenacy/2863/2 "2010-03-24T17:47:15Z")

</div>

Hi Mike,

Multi tenancy is mentioned here in the doc in you haven't seen it already  
[http://www.elasticsearch.com/docs/elasticsearch/rest\_api/search/#Multiple\_Indices\_and\_Types](http://www.elasticsearch.com/docs/elasticsearch/rest_api/search/#Multiple_Indices_and_Types)

API makes it easy to work with that type of configuration. I can't comment  
on the impact of having thousands of indices, but if the twitter example is  
any indication, this should not be a problem.  
[http://www.elasticsearch.com/docs/elasticsearch/rest\_api/search/#Multiple\_Indices\_and\_Types](http://www.elasticsearch.com/docs/elasticsearch/rest_api/search/#Multiple_Indices_and_Types)  
Regards,  
Berkay Mollamustafaoglu  
mberkay on yahoo, google and skype

On Wed, Mar 24, 2010 at 12:56 PM, Michael [olivieri.nicole@gmail.com](mailto:olivieri.nicole@gmail.com) wrote:

> Hi,
> 
> I am considering using Elasticsearch in a multi-tenant application,  
> should I have any concerns using an index per customer? Will thousands  
> of seperate indexes cause any problems? Other than those scaling can  
> fix?
> 
> Also can I secure each index separately?
> 
> Any documentation/samples for multi-tenacy.
> 
> Best.
> 
> Mike

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 24, 2010, 6:28pm UTC](https://discuss.elastic.co/t/multi-tenacy/2863/3 "2010-03-24T18:28:13Z")

</div>

Hi,

Multiple indices support is basically bounded by memory on each  
node/server. Each node in the cluster holds the cluster state (and the  
derived state from it, for example, a parsed version of the mapping  
definition). The cluster state includes all the indices, their mappings and  
so on. To be honest, I have not tried to profile and see what the impact of  
having thousands of indices, but the system is certainly built to handle it  
if memory permits. Moreover, its going to be different from one app to the  
other, since, for example, the mappings used (or automatically created)  
affect the final overhead of each index within the cluster state.

I do know of places that can be optimized to retain less memory, but  
thats the perfect case of premature optimization. What I would suggest is,  
if you can, run a simple test, with the amount of servers, and see how it  
holds. I am certainly here to help and optimize if needed. I do plan to run  
a similar test as soon as I can.

In terms of scaling, assuming each node has enough memory to store the  
cluster state, then yes, the more nodes you will add to the system, the  
better.

Last, as for security, there isn't one built into elasticsearch, so you  
will have to build it on the client side. I definitely plan to add security  
features to elasticsearch, as multi tenancy demands it, but its not going to  
be soon (i.e. in the next couple of months). As a side node, see Hadoop for  
example, they just started to work on a security model :), and they are the  
perfect example for multi tenancy.

-shay.banon

On Wed, Mar 24, 2010 at 7:47 PM, Berkay Mollamustafaoglu  
[mberkay@gmail.com](mailto:mberkay@gmail.com)wrote:

> Hi Mike,
> 
> Multi tenancy is mentioned here in the doc in you haven't seen it already
> 
> [http://www.elasticsearch.com/docs/elasticsearch/rest\_api/search/#Multiple\_Indices\_and\_Types](http://www.elasticsearch.com/docs/elasticsearch/rest_api/search/#Multiple_Indices_and_Types)
> 
> API makes it easy to work with that type of configuration. I can't comment  
> on the impact of having thousands of indices, but if the twitter example is  
> any indication, this should not be a problem.  
> [http://www.elasticsearch.com/docs/elasticsearch/rest\_api/search/#Multiple\_Indices\_and\_Types](http://www.elasticsearch.com/docs/elasticsearch/rest_api/search/#Multiple_Indices_and_Types)  
> Regards,  
> Berkay Mollamustafaoglu  
> mberkay on yahoo, google and skype
> 
> On Wed, Mar 24, 2010 at 12:56 PM, Michael [olivieri.nicole@gmail.com](mailto:olivieri.nicole@gmail.com)wrote:
> 
> > Hi,
> > 
> > I am considering using Elasticsearch in a multi-tenant application,  
> > should I have any concerns using an index per customer? Will thousands  
> > of seperate indexes cause any problems? Other than those scaling can  
> > fix?
> > 
> > Also can I secure each index separately?
> > 
> > Any documentation/samples for multi-tenacy.
> > 
> > Best.
> > 
> > Mike

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 4:25am UTC](https://discuss.elastic.co/t/multi-tenacy/2863/4 "2017-07-06T04:25:08Z")

</div>


