# Shards/Routing Design for my use case

**URL:** <https://discuss.elastic.co/t/shards-routing-design-for-my-use-case/13792>\
**Category:** Elasticsearch\
**Created:** [September 27, 2013, 6:05pm UTC](https://discuss.elastic.co/t/shards-routing-design-for-my-use-case/13792 "2013-09-27T18:05:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Hudson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brian_hudson/32/1306_2.png) [@Brian\_Hudson](https://discuss.elastic.co/u/Brian_Hudson)\
**Post date:** [September 27, 2013, 6:05pm UTC](https://discuss.elastic.co/t/shards-routing-design-for-my-use-case/13792/1 "2013-09-27T18:05:01Z")

</div>

I currently have a system which consists of many Lucene indexes and allows  
users to search over a user-defined subset of these indexes. It works  
(surprisingly?) well, but I am migrating over to ElasticSearch for scale on  
a cluster.

Some stats on the system:  
~2500 Lucene Indexes  
~1M (small) documents per index  
~15 new indexes added each month

Let's assume that there is an index for each student in the current system.  
Each of these students can be categorized into one of 3 majors: English,  
History, Computer Science (not my real use case but this is easier to  
discuss).

In migrating this system over to ElasticSearch I was considering keeping  
the pattern of each student having their own shard (in the case of ES) but  
after listening to Shay Banon's talk on the "kagillion" shards problem (tm)  
I am thinking now that it is not the right approach.

It sounds like the better approach would be to create a single index  
(students) and use routing to route all the documents for a given student  
to the same shard, and then create aliases with filters.

My question is, would there be any advantage to creating 3 indexes  
(english, history, computer\_science) instead of just a single (students)  
index?

If 50% of the students are English majors, 45% are History majors and 5%  
are Computer Science majors would it then make more sense to create the 3  
indexes instead of the single index because I could then allocate more  
shards to english and history than I do computer\_science?

I guess I'm not clear on under what circumstances it is better to create  
multiple indexes over a single index.

Thanks,

Brian

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:14am UTC](https://discuss.elastic.co/t/shards-routing-design-for-my-use-case/13792/2 "2017-07-06T02:14:23Z")

</div>


