# Why use multiple ElasticSearch indices for one web application?

**URL:** <https://discuss.elastic.co/t/why-use-multiple-elasticsearch-indices-for-one-web-application/27092>\
**Category:** Elasticsearch\
**Created:** [August 10, 2015, 2:52am UTC](https://discuss.elastic.co/t/why-use-multiple-elasticsearch-indices-for-one-web-application/27092 "2015-08-10T02:52:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bdb](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@bdb](https://discuss.elastic.co/u/bdb)\
**Post date:** [August 10, 2015, 2:52am UTC](https://discuss.elastic.co/t/why-use-multiple-elasticsearch-indices-for-one-web-application/27092/1 "2015-08-10T02:52:06Z")

</div>

Being new to ES, i would like some advice on the following, please...

In asking a questions relating to using ES for web applications, suggestions have been made to have one index for things like user profiles, another index for data, etc., and several other ones for logs.

Having these all on a cluster with several web applications, this seems like things could get messy or disorganized.

In that case, are people using one cluster per application? I am a bit confused because when I read articles about indexing logs, they seem to refer to storing the data in multiple indices, rather than types within an index.

Secondly, why not have one index per app, with types for logs, user profiles, data, etc.?

Is there some benefit to using multiple indices rather than many types within an index for a web application, of so, what kinds of naming conventions are typical?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 10, 2015, 3:15am UTC](https://discuss.elastic.co/t/why-use-multiple-elasticsearch-indices-for-one-web-application/27092/2 "2015-08-10T03:15:26Z")

</div>

If you were using a more traditional RDBMS, would you put all that data into the same table (irrespective of type)?

---

<div class="post-metadata">

**Author:** ![bdb](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@bdb](https://discuss.elastic.co/u/bdb)\
**Post date:** [August 11, 2015, 4:05pm UTC](https://discuss.elastic.co/t/why-use-multiple-elasticsearch-indices-for-one-web-application/27092/3 "2015-08-11T16:05:16Z")

</div>

Traditionally, all in different tables, which translate to _types_ for ES.

I believe I found the answer to this when looking up pagination [Pagination | Elasticsearch: The Definitive Guide [2.x] | Elastic](https://www.elastic.co/guide/en/elasticsearch/guide/current/pagination.html) .

> Deep Paging in Distributed Systems

> To understand why deep paging is problematic, let’s imagine that we are searching within a single index with five primary shards. When we request the first page of results (results 1 to 10), each shard produces its own top 10 results and returns them to the requesting node, which then sorts all 50 results in order to select the overall top 10.

> Now imagine that we ask for page 1,000—results 10,001 to 10,010. Everything works in the same way except that each shard has to produce its top 10,010 results. The requesting node then sorts through all 50,050 results and discards 50,040 of them!

> You can see that, in a distributed system, the cost of sorting results grows exponentially the deeper we page. There is a good reason that web search engines don’t return more than 1,000 results for any query.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 11, 2015, 9:10pm UTC](https://discuss.elastic.co/t/why-use-multiple-elasticsearch-indices-for-one-web-application/27092/4 "2015-08-11T21:10:40Z")

</div>

> [@bdb](#):
>
> Traditionally, all in different tables, which translate to types for ES.

Depends who you talk to.

I wouldn't be putting all that into the same index.

---

<div class="post-metadata">

**Author:** ![loren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loren/32/44942_2.png) [@loren](https://discuss.elastic.co/u/loren)\
**Post date:** [August 11, 2015, 11:00pm UTC](https://discuss.elastic.co/t/why-use-multiple-elasticsearch-indices-for-one-web-application/27092/5 "2015-08-11T23:00:27Z")

</div>

This one came up before and both @warkolm and I chimed in here: [Types and Indices. One to one?](https://discuss.elastic.co/t/types-and-indices-one-to-one/1190)

---

<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 5, 2017, 11:56pm UTC](https://discuss.elastic.co/t/why-use-multiple-elasticsearch-indices-for-one-web-application/27092/6 "2017-07-05T23:56:22Z")

</div>


