# ElasticSearch : More indices vs More types

**URL:** <https://discuss.elastic.co/t/elasticsearch-more-indices-vs-more-types/114069>\
**Category:** Elasticsearch\
**Created:** [January 4, 2018, 11:20am UTC](https://discuss.elastic.co/t/elasticsearch-more-indices-vs-more-types/114069 "2018-01-04T11:20:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssg](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@ssg](https://discuss.elastic.co/u/ssg)\
**Post date:** [January 4, 2018, 11:20am UTC](https://discuss.elastic.co/t/elasticsearch-more-indices-vs-more-types/114069/1 "2018-01-04T11:20:41Z")

</div>

Hi All,

We are using elasticsearch for the following usecase.  
Elasticsearch Version : 5.1.1  
Note: We are using AWS managed ElasticSearch

We have a multi-tenanted system where in each tenant stores data for multiple things and number of tenants will increase day by day.

exa: Each tenant will have following information.

1] tickets  
2] sw\_inventory  
3] hw\_inventory  
Current indexing stratergy is as follows:

**indexname:**  
tenant\_id (GUID) exa: tenant\_xx1234xx-5b6x-4982-889a-667a758499c8

**types:**

1] tickets  
2] sw\_inventory  
3] hw\_inventory  
Issues we are facing:

1] Conflicts for mappings of common fields exa: (id,name,userId) in types ( tickets,sw\_inventory,hw\_inventory )  
2] As the number of tenants are increasing number of indices can reach upto 1000 or 2000 also.

Will it be a good idea if we reverse the indexing stratergy ?

exa: **index names :**

1] tickets  
2] sw\_inventory  
3] hw\_inventory  
**types:**

tenant\_tenant\_id1  
tenant\_tenant\_id2  
tenant\_tenant\_id3  
tenant\_tenant\_id4  
So there will be only 3 huge indices with N number of types as tenants.

So the question in this case is which solution is better?

1] Many small indices and 3 types  
OR  
2] 3 huge indices and many types

Regards

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 4, 2018, 11:26am UTC](https://discuss.elastic.co/t/elasticsearch-more-indices-vs-more-types/114069/2 "2018-01-04T11:26:16Z")

</div>

[Types are going away](https://www.elastic.co/blog/removal-of-mapping-types-elasticsearch), so in order to future-proof your solution you would be better off modelling without types. Also be aware that having lots of small indices per customer [can be very inefficient and waste heap space](https://www.elastic.co/blog/how-many-shards-should-i-have-in-my-elasticsearch-cluster), so the second approach (possibly with a field indicating the customer that you can filter on instead of a type per customer) could be a better approach.

---

<div class="post-metadata">

**Author:** ![ssg](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@ssg](https://discuss.elastic.co/u/ssg)\
**Post date:** [January 13, 2018, 5:49pm UTC](https://discuss.elastic.co/t/elasticsearch-more-indices-vs-more-types/114069/3 "2018-01-13T17:49:28Z")

</div>

Thanks for reply Christian\_Dahlqvist

---

<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:** [February 10, 2018, 5:49pm UTC](https://discuss.elastic.co/t/elasticsearch-more-indices-vs-more-types/114069/4 "2018-02-10T17:49:43Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
