# Big document or plenty of small documents

**URL:** <https://discuss.elastic.co/t/big-document-or-plenty-of-small-documents/128688>\
**Category:** Elasticsearch\
**Created:** [April 19, 2018, 11:39am UTC](https://discuss.elastic.co/t/big-document-or-plenty-of-small-documents/128688 "2018-04-19T11:39:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebuildy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ebuildy/32/6070_2.png) [@ebuildy](https://discuss.elastic.co/u/ebuildy)\
**Post date:** [April 19, 2018, 11:39am UTC](https://discuss.elastic.co/t/big-document-or-plenty-of-small-documents/128688/1 "2018-04-19T11:39:50Z")

</div>

Question about data model, I am using elasticsearch as a pure "JSON storage", no search, just index/update/get, with big document (JSON of 10 Mb), that contains a big nested array:

`{"cars" : [{ "name" : ..., "model" : ... ... }, ....]}`

It's cool because I need all the cars of 1 document to render the web page, so a simple GET does the trick. But I see indexation is taking lot of memory (via VisualVM) and I see long GC pauses time to time (from elasticsearch log file).

I am wondering if elasticsearch fits well with such big-document or not ?

---

<div class="post-metadata">

**Author:** ![kartheek91](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@kartheek91](https://discuss.elastic.co/u/kartheek91)\
**Post date:** [April 19, 2018, 11:49am UTC](https://discuss.elastic.co/t/big-document-or-plenty-of-small-documents/128688/2 "2018-04-19T11:49:04Z")

</div>

No its not a problem actually you can store max of 2^31-1.You need to check Cluster setup

---

<div class="post-metadata">

**Author:** ![JKhondhu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JKhondhu](https://discuss.elastic.co/u/JKhondhu)\
**Post date:** [April 19, 2018, 4:11pm UTC](https://discuss.elastic.co/t/big-document-or-plenty-of-small-documents/128688/3 "2018-04-19T16:11:49Z")

</div>

@ebuildy What does your JVM heap over time look like? Sawtooth or not so much?

ref: [https://www.elastic.co/blog/a-heap-of-trouble](https://www.elastic.co/blog/a-heap-of-trouble)

---

<div class="post-metadata">

**Author:** ![ebuildy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ebuildy/32/6070_2.png) [@ebuildy](https://discuss.elastic.co/u/ebuildy)\
**Post date:** [April 19, 2018, 4:47pm UTC](https://discuss.elastic.co/t/big-document-or-plenty-of-small-documents/128688/4 "2018-04-19T16:47:52Z")

</div>

Yes it's achieved GC, so I can see the sawtooth, but, in the log:

> [2018-04-19 16:01:00,043][INFO][monitor.jvm] [elasticsearch05] [gc][old][1857][10] duration [6.6s], collections [1]/[7.1s], total [6.6s]/[15.5s], memory [7.3gb]-\>[1gb]/[7.9gb], all\_pools {[young] [10.3kb]-\>[28.2mb]/[266.2mb]}{[survivor] [33.2mb]-\>[0b]/[33.2mb]}{[old] [7.3gb]-\>[1010.7mb]/[7.6gb]}

And, when I index a single document with 23.000 "cars" (nested objects), I can see the heap taking 200Mo:

[http://b3.ms/P5DAvxNbyMgE](http://b3.ms/P5DAvxNbyMgE)

(the problem on prod. is there are plenty of such indexation)

---

<div class="post-metadata">

**Author:** ![ebuildy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ebuildy/32/6070_2.png) [@ebuildy](https://discuss.elastic.co/u/ebuildy)\
**Post date:** [April 19, 2018, 4:48pm UTC](https://discuss.elastic.co/t/big-document-or-plenty-of-small-documents/128688/5 "2018-04-19T16:48:47Z")

</div>

yes it's working, but it slows and it's killing the memory; why cluster is involved here?

---

<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:** [May 17, 2018, 4:48pm UTC](https://discuss.elastic.co/t/big-document-or-plenty-of-small-documents/128688/6 "2018-05-17T16:48:49Z")

</div>

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