Timeseries Databases

What are TimeSeries Databases ?

A Time-series database is an optimised database for storing sequential or time series data. These kinds of databases are used to store and track trends, metrics, user behaviour or sensory data.

Properties

  • Time series databases come into picture when you want to analyse your data over a period of time with granularity from past few seconds to days. In layman terms, when you want to have aggregated results over time and sorted with time, time series database is the way out.

  • Well, you can ask how is it different from having sql database with time as a field, that will still serve the purpose. Time series databases are optimised for high number of inserts and partitioned based on time. They are built for aggregations on time.

  • TSDBs are much more scalable than relational databases. Traditional relational databases don't scale efficiently, however relational databases can still be tuned for time series purposes. Timescale DB is a good example of it.

  • TSDBs provide in-built functionalities and optimizations for data compression, retention policies, variable time aggregations.

  • TSDBs can be built on NoSQL databases as well, like Influx DB.

Use Cases

  • Tracking your application metrics like response rate, failure rate, cpu performance.

  • User tracking on applications like user behavior on social media platforms.

  • Finance applications tracking stock prices

How do we decide whether to use time series database or a real time aggregation system ?

In a scenario where data is arriving at a very high rate and we need query results to be near real time, we might need to consider storage cost as well computation time for query in an un-aggregated data. Real time aggregation using streaming computations like spark-streaming based off a queue can offer accurate results with low latency, and the aggregated results can directly be stored. These aggregates can also be used then to calculate over higher granularity using a simple query.

For More Reading

Last updated