Why OpenTSDB chose HBase for Time Series data storage?
Asked Answered
A

1

16

I would really appreciate if somebody put some light on the choice of HBase as a data storage engine for OpenTSDB?

Which other choices, such as Whisper (Graphite front-end + Carbon persistence), were considered?

How is a column-oriented db such as HBase a better choice for time-series data?

Aplanospore answered 31/8, 2012 at 21:5 Comment(0)
P
59

I chose HBase because it scales. Whisper is much like RRD, it's a fixed-size database, it must destroy data in order to work within its space constraints. HBase offers the following properties that make it very well suited for large scale time series databases:

  1. Linear scaling. Want to store data? Add more nodes. At StumbleUpon, where I wrote OpenTSDB, our time series data was co-located on a 20-node cluster that was primarily used for analytics and batch processing. The cluster grew to 120 nodes fairly quickly, and meanwhile OpenTSDB, which makes up only a tiny fraction of the cluster's workload, grew to half a trillion data points.
  2. Automatic replication. Your data is stored in HDFS, which by default means 3 replicas on 3 different machines. If a machine or a drives dies, no big deal. Drives and machines die all the time when you build commodity servers. But the thing is: you don't really care.
  3. Efficient scans. Most time series data is used to answer questions that are like "what are the data points between time X and Y". If you structure your keys properly, you can implement this very efficiently with HBase with a simple scan operation.
  4. High write throughput. The Bigtable design, which HBase follows, uses LSM trees instead of, say, B-trees, to make writes cheaper (at the expense of potentially more expensive reads).

The fact that HBase is column oriented wasn't nearly as important a consideration as the fact that it's a big sorted key-value system that really scales.

All RRD-based and RRD-derived tools couldn't satisfy the scale requirements of being able to accurately store billions and billions of data points forever for very cheap (just a few bytes of actual disk space per data point).

Plentiful answered 1/9, 2012 at 7:2 Comment(4)
Great answer from the designer of OpenTSDB. Thanks, tsuna!Haehaecceity
Just extending that question, Why did you choose to write a new front-end, when we already have something so powerful as graphite?. Why didn't you extend graphite's backend to store TimeSeries data to HBase instead of whisper ?Arman
The front-end doesn't really matter. I wanted to have a built-in front-end to minimize the dependencies and make the project self-contained, but ultimately we don't want to force everyone to use that front-end, which I know isn't particularly good. The big push for the next feature release is to provide better APIs to allow integration with third-party front-ends, including Graphite.Plentiful
How would you compare OpenTSDB to kairosdb, which is a rewrite of OpenTSDB and supports both HBase and Cassandra?Pathe

© 2022 - 2024 — McMap. All rights reserved.