# What are the limitations of array size in elastic search?

**URL:** <https://discuss.elastic.co/t/what-are-the-limitations-of-array-size-in-elastic-search/108413>\
**Category:** Elasticsearch\
**Created:** [November 20, 2017, 3:17pm UTC](https://discuss.elastic.co/t/what-are-the-limitations-of-array-size-in-elastic-search/108413 "2017-11-20T15:17:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jalaj](https://avatars.discourse-cdn.com/v4/letter/j/e79b87/32.png) [@jalaj](https://discuss.elastic.co/u/jalaj)\
**Post date:** [November 20, 2017, 3:17pm UTC](https://discuss.elastic.co/t/what-are-the-limitations-of-array-size-in-elastic-search/108413/1 "2017-11-20T15:17:55Z")

</div>

I have document which can have a tag array.

```
{
   "name" :"User 1",
   "friends":["user2","user3","user4"]
}

```

What are the performance implications of having several elements on friends Array on insertion , retrieval etc.

Also , when a new element is appended to an array of million elements in ES, how does it impact overall perf. Is the entire array replicated to replica shard or only delta ?

I could not find implications of array size in documentation.

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [November 21, 2017, 2:07pm UTC](https://discuss.elastic.co/t/what-are-the-limitations-of-array-size-in-elastic-search/108413/2 "2017-11-21T14:07:10Z")

</div>

There is no hard limit but it's definitely recommended to keep those arrays "reasonable". When performing an update, Elasticsearch needs to fetch the entire doc, apply the update, then index the updated document and replicate the entire updated document to the replica, so very large arrays would come with a performance penalty indeed.

---

<div class="post-metadata">

**Author:** ![senthil\_mail\_in](https://avatars.discourse-cdn.com/v4/letter/s/85f322/32.png) [@senthil\_mail\_in](https://discuss.elastic.co/u/senthil_mail_in)\
**Post date:** [November 21, 2017, 2:21pm UTC](https://discuss.elastic.co/t/what-are-the-limitations-of-array-size-in-elastic-search/108413/3 "2017-11-21T14:21:42Z")

</div>

@jpountz Is there rough number to design the array size optimize? Specifically in search

---

<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:** [December 19, 2017, 2:22pm UTC](https://discuss.elastic.co/t/what-are-the-limitations-of-array-size-in-elastic-search/108413/4 "2017-12-19T14:22:20Z")

</div>

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