title: Elasticsearch : nested VS flat indicies
body: <p>What are the pros and cons of a nested index in Elasticsearch ? </p>
  
  <p>I am thinking about temporal data of some users or devices so by flat I mean all data are stored at the root of the index and nested I mean data is group by device / id. So there is one document by user/device id that contains one document per entry of time.</p>
  
  <p><strong>I see as pros :</strong> </p>
  
  <ul>
  <li>Nested indices offer more querying possibility</li>
  </ul>
  
  <p><strong>And as cons :</strong> </p>
  
  <ul>
  <li>Write is more costly</li>
  <li>Index management could be really more difficult (how to expire the data ? No easy index rolling, how to easily spread the data into different indices ?)</li>
  </ul>