# Data mode for time series - coarse vs fine grained

**URL:** <https://discuss.elastic.co/t/data-mode-for-time-series-coarse-vs-fine-grained/85925>\
**Category:** Elasticsearch\
**Created:** [May 16, 2017, 12:09pm UTC](https://discuss.elastic.co/t/data-mode-for-time-series-coarse-vs-fine-grained/85925 "2017-05-16T12:09:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bertrand](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bertrand/32/45679_2.png) [@Bertrand](https://discuss.elastic.co/u/Bertrand)\
**Post date:** [May 16, 2017, 12:09pm UTC](https://discuss.elastic.co/t/data-mode-for-time-series-coarse-vs-fine-grained/85925/1 "2017-05-16T12:09:00Z")

</div>

We are storing about 300M data points every day in daily indexes.  
Our current approach creates one document per data point looking as follows:

```auto
{
   "@timestamp": "20170516T130000.000Z",
   "host": "hostname",
   "metric": "jvm.mem.heap.used",
   "value": 1234
}

```

We changed the model recently to build larger documents grouping related metrics together - a bit like what _beats_ is doing:

```auto
{
   "@timestamp": "20170516T130000.000Z",
   "host": "hostname",
   "jvm": {
      "mem": {
         "heap": {
            "used": 1234,
            "committed": 5678,
            "max": 9999
         }
      }
   }
}

```

This strategy helped us to dramatically reduce the amount of documents stored in the indexes by about 50% while keeping the same information.  
We noticed a drop in the memory consumption (heap) required by the indexes. This reduction is mainly due to having less document _uid_ in memory (about 50% less as mentioned).

At first sight this _coarse_ model looks more efficient than the _fine grained_ one.  
Did anybody already come to the same conclusion?  
Do you see any drawbacks?  
Experience and comments are welcome...

Thanks.

/Bertrand

---

<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:** [June 13, 2017, 12:12pm UTC](https://discuss.elastic.co/t/data-mode-for-time-series-coarse-vs-fine-grained/85925/2 "2017-06-13T12:12:39Z")

</div>

Closed on June 13, 2017, 12:12pm UTC

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