# Why datanodes have sharding metadata?

**URL:** <https://discuss.elastic.co/t/why-datanodes-have-sharding-metadata/123609>\
**Category:** Elasticsearch\
**Created:** [March 12, 2018, 5:57pm UTC](https://discuss.elastic.co/t/why-datanodes-have-sharding-metadata/123609 "2018-03-12T17:57:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![shivam.dixit](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@shivam.dixit](https://discuss.elastic.co/u/shivam.dixit)\
**Post date:** [March 12, 2018, 5:57pm UTC](https://discuss.elastic.co/t/why-datanodes-have-sharding-metadata/123609/1 "2018-03-12T17:57:13Z")

</div>

Hi,

According to my understanding, datanodes and masternodes have division of responsibility. I still wonder why datanodes do store the metadata of shards ? Is this not redundant ?  
Is it not okay if we keep the metadata restricted to the masternodes itself, with every datanode querying the masternode for this information.

---

<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:** [March 12, 2018, 6:12pm UTC](https://discuss.elastic.co/t/why-datanodes-have-sharding-metadata/123609/2 "2018-03-12T18:12:04Z")

</div>

Any node in the cluster can act as a coordinating node and therefore need to know the location of all shards. Data nodes also need access to the mappings. As this data is accessed frequently, keeping it in local memory is vital for performance.

---

<div class="post-metadata">

**Author:** ![shivam.dixit](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@shivam.dixit](https://discuss.elastic.co/u/shivam.dixit)\
**Post date:** [March 12, 2018, 7:31pm UTC](https://discuss.elastic.co/t/why-datanodes-have-sharding-metadata/123609/3 "2018-03-12T19:31:44Z")

</div>

Hi, but isn't this highly redundant. This information is definitely something which can be obtained on demand from the master. I understand that solving for latency is definitely the priority.

---

<div class="post-metadata">

**Author:** ![shivam.dixit](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@shivam.dixit](https://discuss.elastic.co/u/shivam.dixit)\
**Post date:** [March 13, 2018, 10:47am UTC](https://discuss.elastic.co/t/why-datanodes-have-sharding-metadata/123609/4 "2018-03-13T10:47:52Z")

</div>

**bump**

---

<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:** [March 13, 2018, 10:51am UTC](https://discuss.elastic.co/t/why-datanodes-have-sharding-metadata/123609/5 "2018-03-13T10:51:15Z")

</div>

Please be patient and do not bump that quickly. This forum is manned by volunteers that generally also have a day job.

This information is stored on all nodes for for performance reasons. As it is accessed frequently, introducing network hops would add a lot of unnecessary network traffic and latency.

---

<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:** [April 10, 2018, 10:51am UTC](https://discuss.elastic.co/t/why-datanodes-have-sharding-metadata/123609/6 "2018-04-10T10:51:22Z")

</div>

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