overview.asciidoc 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[rollup-overview]]
  4. == Overview
  5. experimental[]
  6. Time-based data (documents that are predominantly identified by their timestamp) often have associated retention policies
  7. to manage data growth. For example, your system may be generating 500,000 documents every second. That will generate
  8. 43 million documents per day, and nearly 16 billion documents a year.
  9. While your analysts and data scientists may wish you stored that data indefinitely for analysis, time is never-ending and
  10. so your storage requirements will continue to grow without bound. Retention policies are therefore often dictated
  11. by the simple calculation of storage costs over time, and what the organization is willing to pay to retain historical data.
  12. Often these policies start deleting data after a few months or years.
  13. Storage cost is a fixed quantity. It takes X money to store Y data. But the utility of a piece of data often changes
  14. with time. Sensor data gathered at millisecond granularity is extremely useful right now, reasonably useful if from a
  15. few weeks ago, and only marginally useful if older than a few months.
  16. So while the cost of storing a millisecond of sensor data from ten years ago is fixed, the value of that individual sensor
  17. reading often diminishes with time. It's not useless -- it could easily contribute to a useful analysis -- but it's reduced
  18. value often leads to deletion rather than paying the fixed storage cost.
  19. [float]
  20. === Rollup store historical data at reduced granularity
  21. That's where Rollup comes into play. The Rollup functionality summarizes old, high-granularity data into a reduced
  22. granularity format for long-term storage. By "rolling" the data up into a single summary document, historical data
  23. can be compressed greatly compared to the raw data.
  24. For example, consider the system that's generating 43 million documents every day. The second-by-second data is useful
  25. for real-time analysis, but historical analysis looking over ten years of data are likely to be working at a larger interval
  26. such as hourly or daily trends.
  27. If we compress the 43 million documents into hourly summaries, we can save vast amounts of space. The Rollup feature
  28. automates this process of summarizing historical data.
  29. Details about setting up and configuring Rollup are covered in <<rollup-put-job,Create Job API>>
  30. [float]
  31. === Rollup uses standard query DSL
  32. The Rollup feature exposes a new search endpoint (`/_rollup_search` vs the standard `/_search`) which knows how to search
  33. over rolled-up data. Importantly, this endpoint accepts 100% normal {es} Query DSL. Your application does not need to learn
  34. a new DSL to inspect historical data, it can simply reuse existing queries and dashboards.
  35. There are some limitations to the functionality available; not all queries and aggregations are supported, certain search
  36. features (highlighting, etc) are disabled, and available fields depend on how the rollup was configured. These limitations
  37. are covered more in <<rollup-search-limitations, Rollup Search limitations>>.
  38. But if your queries, aggregations and dashboards only use the available functionality, redirecting them to historical
  39. data is trivial.
  40. [float]
  41. === Rollup merges "live" and "rolled" data
  42. A useful feature of Rollup is the ability to query both "live", realtime data in addition to historical "rolled" data
  43. in a single query.
  44. For example, your system may keep a month of raw data. After a month, it is rolled up into historical summaries using
  45. Rollup and the raw data is deleted.
  46. If you were to query the raw data, you'd only see the most recent month. And if you were to query the rolled up data, you
  47. would only see data older than a month. The RollupSearch endpoint, however, supports querying both at the same time.
  48. It will take the results from both data sources and merge them together. If there is overlap between the "live" and
  49. "rolled" data, live data is preferred to increase accuracy.
  50. [float]
  51. === Rollup is multi-interval aware
  52. Finally, Rollup is capable of intelligently utilizing the best interval available. If you've worked with summarizing
  53. features of other products, you'll find that they can be limiting. If you configure rollups at daily intervals... your
  54. queries and charts can only work with daily intervals. If you need a monthly interval, you have to create another rollup
  55. that explicitly stores monthly averages, etc.
  56. The Rollup feature stores data in such a way that queries can identify the smallest available interval and use that
  57. for their processing. If you store rollups at a daily interval, queries can be executed on daily or longer intervals
  58. (weekly, monthly, etc) without the need to explicitly configure a new rollup job. This helps alleviate one of the major
  59. disadvantages of a rollup system; reduced flexibility relative to raw data.