HBaseCon 2012 | Lessons learned from OpenTSDB - Benoit Sigoure, StumbleUpon

Cloudera, Inc.
Cloudera, Inc.Cloudera, Inc.
Lessons Learned
 from OpenTSDB

Or why OpenTSDB is the way it is
 and how it changed iteratively to
correct some of the mistakes made
                             Benoît “tsuna” Sigoure
                           tsuna@stumbleupon.com
Key concepts

•   Data Points
    (time, value)

•   Metrics
    proc.loadavg.1m

•   Tags
    host=web42     pool=static

•   Metric + Tags = Time Series

•   Order of magnitude: >106 time series, >1012 data points

    put proc.loadavg.1m 1234567890 0.42 host=web42 pool=static
OpenTSDB @ StumbleUpon
• Main production monitoring system for ~2 years
• Storing hundreds of billions of data points
• Adding over 1 billion data points per day
• 13000 data points/s → 130 QPS on HBase
• If you had a 5 node cluster, this load
  would hardly make it sweat
Do’s
• Wider rows to seek faster
  before: ~4KB/row, after: ~20KB
• Make writes idempotent and independent
  before: start rows at arbitrary points in time
  after: align rows on 10m (then 1h) boundaries
• Store more data per KeyValue
  Remember you pay for the key along each value
  in a row, so large keys are really expensive
Don’ts

• Use HTable / HTablePool in app servers
  asynchbase + Netty or Finagle = performance++
• Put variable-length fields in composite keys
  They’re hard to scan
• Exceed a few hundred regions per RegionServer
  “Oversharding” introduces overhead and makes
  recovering from failures more expensive
Use asynchbase
                                         HTable           asynchbase
                scan                          sequential read                     sequential write
50s                             500s                                   200s



38s                             375s                                   150s



25s                             250s                                   100s



13s                             125s                                    50s



 0s                                 0s                                   0s
      4   8      16       24   32        4    8      16       24   32         4   8      16       24   32
              # Threads                           # Threads                           # Threads
How OpenTSDB
         came to be the
            way it is
Questions:
• How to store time series data efficiently in HBase?
• How to enable concurrent writes without
  synchronization between the writers?
• How to save space/memory when storing
  hundreds of billions of data items in HBase?
Ta
     Time Series Data in HBase                    ke
                                                       1

                   Col                 don’t care
                         umn
             Key
             1234567890        1
                                      values
             1234567892        2
timestamps
             1234567894        3


Simplest design: only 1 time series, 1 row with a
single KeyValue per data point.
Supports time-range scans.
Ta
     Time Series Data in HBase                  ke
                                                     2

                     Colu
                         mn
           Key
            foo 1234567890     1

            foo 1234567892     3
  metric
  name     fool 1234567890     2


Metric name first in row key for data locality.
Problem: can’t store the metric as text in row key
due to space concerns
Ta
     Time Series Data in HBase                      ke
                                                         3

                       Colu               Separate
                           mn
           Key                          Lookup Table:
                                          Key    Value
             0x1 1234567890       1
                                          0x1    foo
             0x1 1234567892       3       0x2    fool
  metric
                                           foo   0x1
   ID        0x2 1234567890       2
                                          fool   0x2

Use a separate table to assign unique IDs to
metric names (and tags, not shown here). IDs give us a
predictable length and achieve desired data locality.
Ta
    Time Series Data in HBase                ke
                                                  4

                    Colu
                        mn   +0    +2
          Key
           0x1 1234567890     1    3

           0x1 1234567892     3

           0x2 1234567890     2


Reduce the number of rows by storing multiple
consecutive data points in the same row.
Fewer rows = faster to seek to a specific row.
Ta
       Time Series Data in HBase                             ke
                                                                   4

                          Colu
                              mn   +0       +2
                 Key
                  0x1 1234567890    1       3
  Misleading
     table        0x1 1234567892    3
representation
                  0x2 1234567890    2

 Gotcha #1: wider rows don’t save any space*
                     Key      Colum Value
            le 0x1 1234567890   n
                               +0     1
         ab
      l t d 0x1 1234567890
    ua re                      +2     3          * Until magic prefix
  ct to                        +0     2
                                                 compression happens in
 A s           0x2 1234567890                    upcoming HBase 0.94
Ta
     Time Series Data in HBase                  ke
                                                     4

                     Colu
                         mn    +0    +2
          Key
            0x1 1234567890      1    3

            0x1 1234567892      3

            0x2 1234567890      2


Devil is in the details: when to start new rows?
Naive answer: start on first data point, after some
time start a new row.
Ta
 Time Series Data in HBase                          ke
                                                         4

                       Colu
                           mn   +0
         Key

           0x1 1000000000        1




                    0000 00 1   TSD1
             1000                      First data point:
         foo                           Start a new row
Client                          TSD2
Ta
 Time Series Data in HBase                             ke
                                                            4

                       Colu
                           mn   +0     +10     ...
         Key

           0x1 1000000000        1      2      ...




                    0000 10 2   TSD1
             1000                       Keep adding
         foo
                                        points until...
Client                          TSD2
Ta
 Time Series Data in HBase                            ke
                                                           4

                      Colu
                          mn    +0     +10    ... +599
          Key

            0x1 1000000000       1      2     ...   42




                           42
                 0000 0599      TSD1
                                       ... some arbitrary
         fo o 10
                                         limit, say 10min
Client                          TSD2
Ta
 Time Series Data in HBase                           ke
                                                          4

                      Colu
                          mn    +0     +10   ... +599
          Key
            0x1 1000000000       1      2    ...   42

            0x1 1000000600              51




                           51
                 0000 0610      TSD1
                                       Then start a new
         fo o 10
                                             row
Client                          TSD2
Ta
 Time Series Data in HBase                        ke
                                                       4

                       Colu
                           mn   +0
         Key
           0x1 1234567890        1




     But this scheme fails with multiple TSDs


                    5678 90 1   TSD1   Create new row
         foo 1234
Client                          TSD2
Ta
 Time Series Data in HBase                       ke
                                                      4

                       Colu
                           mn   +0     +2
         Key
           0x1 1234567890        1     3




                    5678 92 3   TSD1    Add to row
         foo 1234
Client                          TSD2
Ta
 Time Series Data in HBase                          ke
                                                         4

                    Colu
                        mn     +0     +2
         Key
          0x1 1234567890       1      3
                                            Oops!
          0x1 1234567892       3

 Maybe a connection failure occurred, client is
     retransmitting data to another TSD

                              TSD1     Add to row
         foo 12345678
                      92 3
Client                        TSD2   Create new row
Ta
      Time Series Data in HBase               ke
                                                   5

                       Colu
                           mn   +90   +92
              Key
    Base
timestamp      0x1 1234567800    1     3
  always a
multiple of    0x2 1234567800    2
    600


In order to scale easily and keep TSD stateless,
make writes independent & idempotent.
New rule: rows are aligned on 10 min. boundaries
Ta
      Time Series Data in HBase               ke
                                                   6

                       Colu
                           mn +1890 +1892
              Key
    Base
timestamp      0x1 1234566000   1     3
  always a
multiple of    0x2 1234566000   2
    3600


1 data point every ~10s => 60 data points / row
Not much. Go to wider rows to further increase
seek speed. One hour rows = 6x fewer rows
Ta
    Time Series Data in HBase                          ke
                                                            6

                        Colu
                              mn +1890 +1892
           Key
             0x1 1234566000          1      3

             0x2 1234566000          2

Remember: wider rows don’t save any space!
                   Key         Colum Value Key is easily 4x
          le 0x1 1234566000      n
                               +1890   1     bigger than
      tab                                  column + value
    al ed 0x1 1234566000
  tu or
                               +1892   3
Ac st        0x2 1234566000    +1890   2    and repeated
Ta
      Time Series Data in HBase                                ke
                                                                    7

                            Colu
                                 mn   +1890 +1890 +1892 +1892
              Key
                   0x1 1234566000      1      1    3     3

                   0x2 1234566000      2

Solution: “compact” columns by concatenation
                     Key      Column Value Space savings
          le 0x1   1234566000 +1890        1   on disk and in
      tab
    al ed 0x1
  tu or            1234566000 +1890,+1892 1, 3 memory are
Ac st        0x1   1234566000 +1892        3    huge: data is
           0x2     1234566000 +1890        2 4x-8x smaller!
¿ Questions ?
            ub
            tH
        Gi
       on

                   opentsdb.net
    e
   m
  kr
Fo




                                Summary

 • Use asynchbase             • Use Netty or Finagle
 • Wider table > Taller table • Short family names
 • Make writes idempotent • Make writes independent
 • Compact your data          • Have predictable key sizes
                                    ool?
                   Thin k this is c          Benoît “tsuna” Sigoure
                 W e’re hiring             tsuna@stumbleupon.com
1 of 25

Recommended

Time-Series Apache HBase by
Time-Series Apache HBaseTime-Series Apache HBase
Time-Series Apache HBaseHBaseCon
5.6K views17 slides
Hadoop World 2011: Advanced HBase Schema Design - Lars George, Cloudera by
Hadoop World 2011: Advanced HBase Schema Design - Lars George, ClouderaHadoop World 2011: Advanced HBase Schema Design - Lars George, Cloudera
Hadoop World 2011: Advanced HBase Schema Design - Lars George, ClouderaCloudera, Inc.
8.8K views34 slides
HBaseCon 2013: Apache HBase Table Snapshots by
HBaseCon 2013: Apache HBase Table SnapshotsHBaseCon 2013: Apache HBase Table Snapshots
HBaseCon 2013: Apache HBase Table SnapshotsCloudera, Inc.
11.8K views61 slides
Hadoopのシステム設計・運用のポイント by
Hadoopのシステム設計・運用のポイントHadoopのシステム設計・運用のポイント
Hadoopのシステム設計・運用のポイントCloudera Japan
34.7K views57 slides
[211] HBase 기반 검색 데이터 저장소 (공개용) by
[211] HBase 기반 검색 데이터 저장소 (공개용)[211] HBase 기반 검색 데이터 저장소 (공개용)
[211] HBase 기반 검색 데이터 저장소 (공개용)NAVER D2
8.5K views73 slides
Scaling HBase for Big Data by
Scaling HBase for Big DataScaling HBase for Big Data
Scaling HBase for Big DataSalesforce Engineering
2.1K views50 slides

More Related Content

What's hot

Apache Tez - A New Chapter in Hadoop Data Processing by
Apache Tez - A New Chapter in Hadoop Data ProcessingApache Tez - A New Chapter in Hadoop Data Processing
Apache Tez - A New Chapter in Hadoop Data ProcessingDataWorks Summit
18.3K views39 slides
RocksDB compaction by
RocksDB compactionRocksDB compaction
RocksDB compactionMIJIN AN
8.5K views26 slides
Hive+Tez: A performance deep dive by
Hive+Tez: A performance deep diveHive+Tez: A performance deep dive
Hive+Tez: A performance deep divet3rmin4t0r
9.6K views41 slides
Hive + Tez: A Performance Deep Dive by
Hive + Tez: A Performance Deep DiveHive + Tez: A Performance Deep Dive
Hive + Tez: A Performance Deep DiveDataWorks Summit
57.6K views41 slides
hbaseconasia2019 HBCK2: Concepts, trends, and recipes for fixing issues in HB... by
hbaseconasia2019 HBCK2: Concepts, trends, and recipes for fixing issues in HB...hbaseconasia2019 HBCK2: Concepts, trends, and recipes for fixing issues in HB...
hbaseconasia2019 HBCK2: Concepts, trends, and recipes for fixing issues in HB...Michael Stack
582 views16 slides
Top 5 Mistakes When Writing Spark Applications by
Top 5 Mistakes When Writing Spark ApplicationsTop 5 Mistakes When Writing Spark Applications
Top 5 Mistakes When Writing Spark ApplicationsSpark Summit
26.4K views75 slides

What's hot(20)

Apache Tez - A New Chapter in Hadoop Data Processing by DataWorks Summit
Apache Tez - A New Chapter in Hadoop Data ProcessingApache Tez - A New Chapter in Hadoop Data Processing
Apache Tez - A New Chapter in Hadoop Data Processing
DataWorks Summit18.3K views
RocksDB compaction by MIJIN AN
RocksDB compactionRocksDB compaction
RocksDB compaction
MIJIN AN8.5K views
Hive+Tez: A performance deep dive by t3rmin4t0r
Hive+Tez: A performance deep diveHive+Tez: A performance deep dive
Hive+Tez: A performance deep dive
t3rmin4t0r9.6K views
Hive + Tez: A Performance Deep Dive by DataWorks Summit
Hive + Tez: A Performance Deep DiveHive + Tez: A Performance Deep Dive
Hive + Tez: A Performance Deep Dive
DataWorks Summit57.6K views
hbaseconasia2019 HBCK2: Concepts, trends, and recipes for fixing issues in HB... by Michael Stack
hbaseconasia2019 HBCK2: Concepts, trends, and recipes for fixing issues in HB...hbaseconasia2019 HBCK2: Concepts, trends, and recipes for fixing issues in HB...
hbaseconasia2019 HBCK2: Concepts, trends, and recipes for fixing issues in HB...
Michael Stack582 views
Top 5 Mistakes When Writing Spark Applications by Spark Summit
Top 5 Mistakes When Writing Spark ApplicationsTop 5 Mistakes When Writing Spark Applications
Top 5 Mistakes When Writing Spark Applications
Spark Summit26.4K views
Building Event Streaming Architectures on Scylla and Kafka by ScyllaDB
Building Event Streaming Architectures on Scylla and KafkaBuilding Event Streaming Architectures on Scylla and Kafka
Building Event Streaming Architectures on Scylla and Kafka
ScyllaDB861 views
Apache Hudi: The Path Forward by Alluxio, Inc.
Apache Hudi: The Path ForwardApache Hudi: The Path Forward
Apache Hudi: The Path Forward
Alluxio, Inc.490 views
Performance Optimizations in Apache Impala by Cloudera, Inc.
Performance Optimizations in Apache ImpalaPerformance Optimizations in Apache Impala
Performance Optimizations in Apache Impala
Cloudera, Inc.10.7K views
HBase and HDFS: Understanding FileSystem Usage in HBase by enissoz
HBase and HDFS: Understanding FileSystem Usage in HBaseHBase and HDFS: Understanding FileSystem Usage in HBase
HBase and HDFS: Understanding FileSystem Usage in HBase
enissoz74K views
Big Data in Real-Time at Twitter by nkallen
Big Data in Real-Time at TwitterBig Data in Real-Time at Twitter
Big Data in Real-Time at Twitter
nkallen139.3K views
Streaming Data Lakes using Kafka Connect + Apache Hudi | Vinoth Chandar, Apac... by HostedbyConfluent
Streaming Data Lakes using Kafka Connect + Apache Hudi | Vinoth Chandar, Apac...Streaming Data Lakes using Kafka Connect + Apache Hudi | Vinoth Chandar, Apac...
Streaming Data Lakes using Kafka Connect + Apache Hudi | Vinoth Chandar, Apac...
HostedbyConfluent4.3K views
Intro to HBase by alexbaranau
Intro to HBaseIntro to HBase
Intro to HBase
alexbaranau42.6K views
ORC File - Optimizing Your Big Data by DataWorks Summit
ORC File - Optimizing Your Big DataORC File - Optimizing Your Big Data
ORC File - Optimizing Your Big Data
DataWorks Summit11.6K views
A Survey of HBase Application Archetypes by HBaseCon
A Survey of HBase Application ArchetypesA Survey of HBase Application Archetypes
A Survey of HBase Application Archetypes
HBaseCon20K views
Tuning Apache Ambari performance for Big Data at scale with 3000 agents by DataWorks Summit
Tuning Apache Ambari performance for Big Data at scale with 3000 agentsTuning Apache Ambari performance for Big Data at scale with 3000 agents
Tuning Apache Ambari performance for Big Data at scale with 3000 agents
DataWorks Summit2.2K views
Facebook Messages & HBase by 强 王
Facebook Messages & HBaseFacebook Messages & HBase
Facebook Messages & HBase
强 王39.2K views

Viewers also liked

Monitoring MySQL with OpenTSDB by
Monitoring MySQL with OpenTSDBMonitoring MySQL with OpenTSDB
Monitoring MySQL with OpenTSDBGeoffrey Anderson
16.6K views42 slides
opentsdb in a real enviroment by
opentsdb in a real enviromentopentsdb in a real enviroment
opentsdb in a real enviromentChen Robert
11.6K views8 slides
OpenTSDB 2.0 by
OpenTSDB 2.0OpenTSDB 2.0
OpenTSDB 2.0HBaseCon
18.3K views41 slides
Twitter Storm: Ereignisverarbeitung in Echtzeit by
Twitter Storm: Ereignisverarbeitung in EchtzeitTwitter Storm: Ereignisverarbeitung in Echtzeit
Twitter Storm: Ereignisverarbeitung in EchtzeitGuido Schmutz
3.7K views40 slides
HCatalog: Table Management for Hadoop - CHUG - 20120917 by
HCatalog: Table Management for Hadoop - CHUG - 20120917HCatalog: Table Management for Hadoop - CHUG - 20120917
HCatalog: Table Management for Hadoop - CHUG - 20120917Chicago Hadoop Users Group
7.1K views26 slides
Hadoop basics by
Hadoop basicsHadoop basics
Hadoop basicsAntonio Silveira
13.5K views36 slides

Viewers also liked(20)

opentsdb in a real enviroment by Chen Robert
opentsdb in a real enviromentopentsdb in a real enviroment
opentsdb in a real enviroment
Chen Robert11.6K views
OpenTSDB 2.0 by HBaseCon
OpenTSDB 2.0OpenTSDB 2.0
OpenTSDB 2.0
HBaseCon18.3K views
Twitter Storm: Ereignisverarbeitung in Echtzeit by Guido Schmutz
Twitter Storm: Ereignisverarbeitung in EchtzeitTwitter Storm: Ereignisverarbeitung in Echtzeit
Twitter Storm: Ereignisverarbeitung in Echtzeit
Guido Schmutz3.7K views
Making Big Data Analytics Interactive and Real-­Time by Seven Nguyen
 Making Big Data Analytics Interactive and Real-­Time Making Big Data Analytics Interactive and Real-­Time
Making Big Data Analytics Interactive and Real-­Time
Seven Nguyen8.6K views
Using Morphlines for On-the-Fly ETL by Cloudera, Inc.
Using Morphlines for On-the-Fly ETLUsing Morphlines for On-the-Fly ETL
Using Morphlines for On-the-Fly ETL
Cloudera, Inc.18.8K views
How we solved Real-time User Segmentation using HBase by DataWorks Summit
How we solved Real-time User Segmentation using HBaseHow we solved Real-time User Segmentation using HBase
How we solved Real-time User Segmentation using HBase
DataWorks Summit11.4K views
Intro to Pig UDF by Chris Wilkes
Intro to Pig UDFIntro to Pig UDF
Intro to Pig UDF
Chris Wilkes15.7K views
Deploying Apache Flume to enable low-latency analytics by DataWorks Summit
Deploying Apache Flume to enable low-latency analyticsDeploying Apache Flume to enable low-latency analytics
Deploying Apache Flume to enable low-latency analytics
DataWorks Summit13.7K views
A real time architecture using Hadoop and Storm @ FOSDEM 2013 by Nathan Bijnens
A real time architecture using Hadoop and Storm @ FOSDEM 2013A real time architecture using Hadoop and Storm @ FOSDEM 2013
A real time architecture using Hadoop and Storm @ FOSDEM 2013
Nathan Bijnens34K views
HBaseCon 2013: OpenTSDB at Box by Cloudera, Inc.
HBaseCon 2013: OpenTSDB at BoxHBaseCon 2013: OpenTSDB at Box
HBaseCon 2013: OpenTSDB at Box
Cloudera, Inc.8.8K views
HBaseCon 2015: OpenTSDB and AsyncHBase Update by HBaseCon
HBaseCon 2015: OpenTSDB and AsyncHBase UpdateHBaseCon 2015: OpenTSDB and AsyncHBase Update
HBaseCon 2015: OpenTSDB and AsyncHBase Update
HBaseCon7.7K views
Intro to HBase Internals & Schema Design (for HBase users) by alexbaranau
Intro to HBase Internals & Schema Design (for HBase users)Intro to HBase Internals & Schema Design (for HBase users)
Intro to HBase Internals & Schema Design (for HBase users)
alexbaranau28.1K views
Apache Hadoop YARN - Enabling Next Generation Data Applications by Hortonworks
Apache Hadoop YARN - Enabling Next Generation Data ApplicationsApache Hadoop YARN - Enabling Next Generation Data Applications
Apache Hadoop YARN - Enabling Next Generation Data Applications
Hortonworks60.4K views
Integration of Hive and HBase by Hortonworks
Integration of Hive and HBaseIntegration of Hive and HBase
Integration of Hive and HBase
Hortonworks99.6K views
HBaseCon 2012 | HBase Schema Design - Ian Varley, Salesforce by Cloudera, Inc.
HBaseCon 2012 | HBase Schema Design - Ian Varley, SalesforceHBaseCon 2012 | HBase Schema Design - Ian Varley, Salesforce
HBaseCon 2012 | HBase Schema Design - Ian Varley, Salesforce
Cloudera, Inc.41.7K views

Similar to HBaseCon 2012 | Lessons learned from OpenTSDB - Benoit Sigoure, StumbleUpon

Taming Cassandra by
Taming CassandraTaming Cassandra
Taming CassandraDmitry Buzdin
1.2K views47 slides
Introduce Apache Cassandra - JavaTwo Taiwan, 2012 by
Introduce Apache Cassandra - JavaTwo Taiwan, 2012Introduce Apache Cassandra - JavaTwo Taiwan, 2012
Introduce Apache Cassandra - JavaTwo Taiwan, 2012Boris Yen
1.9K views26 slides
MongoDB: Scaling write performance | Devon 2012 by
MongoDB: Scaling write performance | Devon 2012MongoDB: Scaling write performance | Devon 2012
MongoDB: Scaling write performance | Devon 2012Daum DNA
4.1K views45 slides
Update on OpenTSDB and AsyncHBase by
Update on OpenTSDB and AsyncHBase Update on OpenTSDB and AsyncHBase
Update on OpenTSDB and AsyncHBase HBaseCon
803 views32 slides
Hadoop Summit 2012 | Bayesian Counters AKA In Memory Data Mining for Large Da... by
Hadoop Summit 2012 | Bayesian Counters AKA In Memory Data Mining for Large Da...Hadoop Summit 2012 | Bayesian Counters AKA In Memory Data Mining for Large Da...
Hadoop Summit 2012 | Bayesian Counters AKA In Memory Data Mining for Large Da...Cloudera, Inc.
2.1K views29 slides
Bayesian Counters by
Bayesian CountersBayesian Counters
Bayesian CountersDataWorks Summit
1.4K views32 slides

Similar to HBaseCon 2012 | Lessons learned from OpenTSDB - Benoit Sigoure, StumbleUpon(20)

Introduce Apache Cassandra - JavaTwo Taiwan, 2012 by Boris Yen
Introduce Apache Cassandra - JavaTwo Taiwan, 2012Introduce Apache Cassandra - JavaTwo Taiwan, 2012
Introduce Apache Cassandra - JavaTwo Taiwan, 2012
Boris Yen1.9K views
MongoDB: Scaling write performance | Devon 2012 by Daum DNA
MongoDB: Scaling write performance | Devon 2012MongoDB: Scaling write performance | Devon 2012
MongoDB: Scaling write performance | Devon 2012
Daum DNA4.1K views
Update on OpenTSDB and AsyncHBase by HBaseCon
Update on OpenTSDB and AsyncHBase Update on OpenTSDB and AsyncHBase
Update on OpenTSDB and AsyncHBase
HBaseCon803 views
Hadoop Summit 2012 | Bayesian Counters AKA In Memory Data Mining for Large Da... by Cloudera, Inc.
Hadoop Summit 2012 | Bayesian Counters AKA In Memory Data Mining for Large Da...Hadoop Summit 2012 | Bayesian Counters AKA In Memory Data Mining for Large Da...
Hadoop Summit 2012 | Bayesian Counters AKA In Memory Data Mining for Large Da...
Cloudera, Inc.2.1K views
Intro to Cassandra by Tyler Hobbs
Intro to CassandraIntro to Cassandra
Intro to Cassandra
Tyler Hobbs6.9K views
Near-realtime analytics with Kafka and HBase by dave_revell
Near-realtime analytics with Kafka and HBaseNear-realtime analytics with Kafka and HBase
Near-realtime analytics with Kafka and HBase
dave_revell23.6K views
Mongodb - Scaling write performance by Daum DNA
Mongodb - Scaling write performanceMongodb - Scaling write performance
Mongodb - Scaling write performance
Daum DNA15.5K views
Introduction to Cassandra by Hanborq Inc.
Introduction to CassandraIntroduction to Cassandra
Introduction to Cassandra
Hanborq Inc.1.3K views
Apache Cassandra Opinion and Fact by mediumdata
Apache Cassandra Opinion and FactApache Cassandra Opinion and Fact
Apache Cassandra Opinion and Fact
mediumdata270 views
TriHUG January 2012 Talk by Chris Shain by trihug
TriHUG January 2012 Talk by Chris ShainTriHUG January 2012 Talk by Chris Shain
TriHUG January 2012 Talk by Chris Shain
trihug1.6K views
Slide presentation pycassa_upload by Rajini Ramesh
Slide presentation pycassa_uploadSlide presentation pycassa_upload
Slide presentation pycassa_upload
Rajini Ramesh666 views
Cassandra for Ruby/Rails Devs by Tyler Hobbs
Cassandra for Ruby/Rails DevsCassandra for Ruby/Rails Devs
Cassandra for Ruby/Rails Devs
Tyler Hobbs3.9K views
Assembler by Mohd Arif
AssemblerAssembler
Assembler
Mohd Arif9.8K views
Indexing and Mining a Billion Time series using iSAX 2.0 by Vasu Jain
Indexing and Mining a Billion Time series using iSAX 2.0Indexing and Mining a Billion Time series using iSAX 2.0
Indexing and Mining a Billion Time series using iSAX 2.0
Vasu Jain3.1K views

More from Cloudera, Inc.

Partner Briefing_January 25 (FINAL).pptx by
Partner Briefing_January 25 (FINAL).pptxPartner Briefing_January 25 (FINAL).pptx
Partner Briefing_January 25 (FINAL).pptxCloudera, Inc.
107 views55 slides
Cloudera Data Impact Awards 2021 - Finalists by
Cloudera Data Impact Awards 2021 - Finalists Cloudera Data Impact Awards 2021 - Finalists
Cloudera Data Impact Awards 2021 - Finalists Cloudera, Inc.
6.4K views34 slides
2020 Cloudera Data Impact Awards Finalists by
2020 Cloudera Data Impact Awards Finalists2020 Cloudera Data Impact Awards Finalists
2020 Cloudera Data Impact Awards FinalistsCloudera, Inc.
6.3K views43 slides
Edc event vienna presentation 1 oct 2019 by
Edc event vienna presentation 1 oct 2019Edc event vienna presentation 1 oct 2019
Edc event vienna presentation 1 oct 2019Cloudera, Inc.
4.5K views67 slides
Machine Learning with Limited Labeled Data 4/3/19 by
Machine Learning with Limited Labeled Data 4/3/19Machine Learning with Limited Labeled Data 4/3/19
Machine Learning with Limited Labeled Data 4/3/19Cloudera, Inc.
3.6K views36 slides
Data Driven With the Cloudera Modern Data Warehouse 3.19.19 by
Data Driven With the Cloudera Modern Data Warehouse 3.19.19Data Driven With the Cloudera Modern Data Warehouse 3.19.19
Data Driven With the Cloudera Modern Data Warehouse 3.19.19Cloudera, Inc.
2.5K views21 slides

More from Cloudera, Inc.(20)

Partner Briefing_January 25 (FINAL).pptx by Cloudera, Inc.
Partner Briefing_January 25 (FINAL).pptxPartner Briefing_January 25 (FINAL).pptx
Partner Briefing_January 25 (FINAL).pptx
Cloudera, Inc.107 views
Cloudera Data Impact Awards 2021 - Finalists by Cloudera, Inc.
Cloudera Data Impact Awards 2021 - Finalists Cloudera Data Impact Awards 2021 - Finalists
Cloudera Data Impact Awards 2021 - Finalists
Cloudera, Inc.6.4K views
2020 Cloudera Data Impact Awards Finalists by Cloudera, Inc.
2020 Cloudera Data Impact Awards Finalists2020 Cloudera Data Impact Awards Finalists
2020 Cloudera Data Impact Awards Finalists
Cloudera, Inc.6.3K views
Edc event vienna presentation 1 oct 2019 by Cloudera, Inc.
Edc event vienna presentation 1 oct 2019Edc event vienna presentation 1 oct 2019
Edc event vienna presentation 1 oct 2019
Cloudera, Inc.4.5K views
Machine Learning with Limited Labeled Data 4/3/19 by Cloudera, Inc.
Machine Learning with Limited Labeled Data 4/3/19Machine Learning with Limited Labeled Data 4/3/19
Machine Learning with Limited Labeled Data 4/3/19
Cloudera, Inc.3.6K views
Data Driven With the Cloudera Modern Data Warehouse 3.19.19 by Cloudera, Inc.
Data Driven With the Cloudera Modern Data Warehouse 3.19.19Data Driven With the Cloudera Modern Data Warehouse 3.19.19
Data Driven With the Cloudera Modern Data Warehouse 3.19.19
Cloudera, Inc.2.5K views
Introducing Cloudera DataFlow (CDF) 2.13.19 by Cloudera, Inc.
Introducing Cloudera DataFlow (CDF) 2.13.19Introducing Cloudera DataFlow (CDF) 2.13.19
Introducing Cloudera DataFlow (CDF) 2.13.19
Cloudera, Inc.4.9K views
Introducing Cloudera Data Science Workbench for HDP 2.12.19 by Cloudera, Inc.
Introducing Cloudera Data Science Workbench for HDP 2.12.19Introducing Cloudera Data Science Workbench for HDP 2.12.19
Introducing Cloudera Data Science Workbench for HDP 2.12.19
Cloudera, Inc.2.7K views
Shortening the Sales Cycle with a Modern Data Warehouse 1.30.19 by Cloudera, Inc.
Shortening the Sales Cycle with a Modern Data Warehouse 1.30.19Shortening the Sales Cycle with a Modern Data Warehouse 1.30.19
Shortening the Sales Cycle with a Modern Data Warehouse 1.30.19
Cloudera, Inc.1.6K views
Leveraging the cloud for analytics and machine learning 1.29.19 by Cloudera, Inc.
Leveraging the cloud for analytics and machine learning 1.29.19Leveraging the cloud for analytics and machine learning 1.29.19
Leveraging the cloud for analytics and machine learning 1.29.19
Cloudera, Inc.1.6K views
Modernizing the Legacy Data Warehouse – What, Why, and How 1.23.19 by Cloudera, Inc.
Modernizing the Legacy Data Warehouse – What, Why, and How 1.23.19Modernizing the Legacy Data Warehouse – What, Why, and How 1.23.19
Modernizing the Legacy Data Warehouse – What, Why, and How 1.23.19
Cloudera, Inc.2.5K views
Leveraging the Cloud for Big Data Analytics 12.11.18 by Cloudera, Inc.
Leveraging the Cloud for Big Data Analytics 12.11.18Leveraging the Cloud for Big Data Analytics 12.11.18
Leveraging the Cloud for Big Data Analytics 12.11.18
Cloudera, Inc.1.7K views
Modern Data Warehouse Fundamentals Part 3 by Cloudera, Inc.
Modern Data Warehouse Fundamentals Part 3Modern Data Warehouse Fundamentals Part 3
Modern Data Warehouse Fundamentals Part 3
Cloudera, Inc.1.3K views
Modern Data Warehouse Fundamentals Part 2 by Cloudera, Inc.
Modern Data Warehouse Fundamentals Part 2Modern Data Warehouse Fundamentals Part 2
Modern Data Warehouse Fundamentals Part 2
Cloudera, Inc.2.3K views
Modern Data Warehouse Fundamentals Part 1 by Cloudera, Inc.
Modern Data Warehouse Fundamentals Part 1Modern Data Warehouse Fundamentals Part 1
Modern Data Warehouse Fundamentals Part 1
Cloudera, Inc.1.5K views
Extending Cloudera SDX beyond the Platform by Cloudera, Inc.
Extending Cloudera SDX beyond the PlatformExtending Cloudera SDX beyond the Platform
Extending Cloudera SDX beyond the Platform
Cloudera, Inc.966 views
Federated Learning: ML with Privacy on the Edge 11.15.18 by Cloudera, Inc.
Federated Learning: ML with Privacy on the Edge 11.15.18Federated Learning: ML with Privacy on the Edge 11.15.18
Federated Learning: ML with Privacy on the Edge 11.15.18
Cloudera, Inc.2.2K views
Analyst Webinar: Doing a 180 on Customer 360 by Cloudera, Inc.
Analyst Webinar: Doing a 180 on Customer 360Analyst Webinar: Doing a 180 on Customer 360
Analyst Webinar: Doing a 180 on Customer 360
Cloudera, Inc.1.4K views
Build a modern platform for anti-money laundering 9.19.18 by Cloudera, Inc.
Build a modern platform for anti-money laundering 9.19.18Build a modern platform for anti-money laundering 9.19.18
Build a modern platform for anti-money laundering 9.19.18
Cloudera, Inc.1K views
Introducing the data science sandbox as a service 8.30.18 by Cloudera, Inc.
Introducing the data science sandbox as a service 8.30.18Introducing the data science sandbox as a service 8.30.18
Introducing the data science sandbox as a service 8.30.18
Cloudera, Inc.1.2K views

Recently uploaded

Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu... by
Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu...Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu...
Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu...NUS-ISS
32 views54 slides
ChatGPT and AI for Web Developers by
ChatGPT and AI for Web DevelopersChatGPT and AI for Web Developers
ChatGPT and AI for Web DevelopersMaximiliano Firtman
174 views82 slides
Business Analyst Series 2023 - Week 3 Session 5 by
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5DianaGray10
165 views20 slides
.conf Go 2023 - Data analysis as a routine by
.conf Go 2023 - Data analysis as a routine.conf Go 2023 - Data analysis as a routine
.conf Go 2023 - Data analysis as a routineSplunk
90 views12 slides
AMAZON PRODUCT RESEARCH.pdf by
AMAZON PRODUCT RESEARCH.pdfAMAZON PRODUCT RESEARCH.pdf
AMAZON PRODUCT RESEARCH.pdfJerikkLaureta
14 views13 slides

Recently uploaded(20)

Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu... by NUS-ISS
Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu...Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu...
Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu...
NUS-ISS32 views
Business Analyst Series 2023 - Week 3 Session 5 by DianaGray10
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5
DianaGray10165 views
.conf Go 2023 - Data analysis as a routine by Splunk
.conf Go 2023 - Data analysis as a routine.conf Go 2023 - Data analysis as a routine
.conf Go 2023 - Data analysis as a routine
Splunk90 views
AMAZON PRODUCT RESEARCH.pdf by JerikkLaureta
AMAZON PRODUCT RESEARCH.pdfAMAZON PRODUCT RESEARCH.pdf
AMAZON PRODUCT RESEARCH.pdf
JerikkLaureta14 views
Special_edition_innovator_2023.pdf by WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2214 views
Future of Learning - Yap Aye Wee.pdf by NUS-ISS
Future of Learning - Yap Aye Wee.pdfFuture of Learning - Yap Aye Wee.pdf
Future of Learning - Yap Aye Wee.pdf
NUS-ISS38 views
Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum... by NUS-ISS
Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum...Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum...
Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum...
NUS-ISS28 views
Black and White Modern Science Presentation.pptx by maryamkhalid2916
Black and White Modern Science Presentation.pptxBlack and White Modern Science Presentation.pptx
Black and White Modern Science Presentation.pptx
maryamkhalid291614 views
SAP Automation Using Bar Code and FIORI.pdf by Virendra Rai, PMP
SAP Automation Using Bar Code and FIORI.pdfSAP Automation Using Bar Code and FIORI.pdf
SAP Automation Using Bar Code and FIORI.pdf
[2023] Putting the R! in R&D.pdf by Eleanor McHugh
[2023] Putting the R! in R&D.pdf[2023] Putting the R! in R&D.pdf
[2023] Putting the R! in R&D.pdf
Eleanor McHugh38 views
DALI Basics Course 2023 by Ivory Egg
DALI Basics Course  2023DALI Basics Course  2023
DALI Basics Course 2023
Ivory Egg14 views
Attacking IoT Devices from a Web Perspective - Linux Day by Simone Onofri
Attacking IoT Devices from a Web Perspective - Linux Day Attacking IoT Devices from a Web Perspective - Linux Day
Attacking IoT Devices from a Web Perspective - Linux Day
Simone Onofri15 views
How the World's Leading Independent Automotive Distributor is Reinventing Its... by NUS-ISS
How the World's Leading Independent Automotive Distributor is Reinventing Its...How the World's Leading Independent Automotive Distributor is Reinventing Its...
How the World's Leading Independent Automotive Distributor is Reinventing Its...
NUS-ISS15 views
Data-centric AI and the convergence of data and model engineering: opportunit... by Paolo Missier
Data-centric AI and the convergence of data and model engineering:opportunit...Data-centric AI and the convergence of data and model engineering:opportunit...
Data-centric AI and the convergence of data and model engineering: opportunit...
Paolo Missier29 views
Combining Orchestration and Choreography for a Clean Architecture by ThomasHeinrichs1
Combining Orchestration and Choreography for a Clean ArchitectureCombining Orchestration and Choreography for a Clean Architecture
Combining Orchestration and Choreography for a Clean Architecture
ThomasHeinrichs168 views
Empathic Computing: Delivering the Potential of the Metaverse by Mark Billinghurst
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the Metaverse
Mark Billinghurst449 views
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors by sugiuralab
TouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective SensorsTouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective Sensors
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors
sugiuralab11 views

HBaseCon 2012 | Lessons learned from OpenTSDB - Benoit Sigoure, StumbleUpon

  • 1. Lessons Learned from OpenTSDB Or why OpenTSDB is the way it is and how it changed iteratively to correct some of the mistakes made Benoît “tsuna” Sigoure tsuna@stumbleupon.com
  • 2. Key concepts • Data Points (time, value) • Metrics proc.loadavg.1m • Tags host=web42 pool=static • Metric + Tags = Time Series • Order of magnitude: >106 time series, >1012 data points put proc.loadavg.1m 1234567890 0.42 host=web42 pool=static
  • 3. OpenTSDB @ StumbleUpon • Main production monitoring system for ~2 years • Storing hundreds of billions of data points • Adding over 1 billion data points per day • 13000 data points/s → 130 QPS on HBase • If you had a 5 node cluster, this load would hardly make it sweat
  • 4. Do’s • Wider rows to seek faster before: ~4KB/row, after: ~20KB • Make writes idempotent and independent before: start rows at arbitrary points in time after: align rows on 10m (then 1h) boundaries • Store more data per KeyValue Remember you pay for the key along each value in a row, so large keys are really expensive
  • 5. Don’ts • Use HTable / HTablePool in app servers asynchbase + Netty or Finagle = performance++ • Put variable-length fields in composite keys They’re hard to scan • Exceed a few hundred regions per RegionServer “Oversharding” introduces overhead and makes recovering from failures more expensive
  • 6. Use asynchbase HTable asynchbase scan sequential read sequential write 50s 500s 200s 38s 375s 150s 25s 250s 100s 13s 125s 50s 0s 0s 0s 4 8 16 24 32 4 8 16 24 32 4 8 16 24 32 # Threads # Threads # Threads
  • 7. How OpenTSDB came to be the way it is Questions: • How to store time series data efficiently in HBase? • How to enable concurrent writes without synchronization between the writers? • How to save space/memory when storing hundreds of billions of data items in HBase?
  • 8. Ta Time Series Data in HBase ke 1 Col don’t care umn Key 1234567890 1 values 1234567892 2 timestamps 1234567894 3 Simplest design: only 1 time series, 1 row with a single KeyValue per data point. Supports time-range scans.
  • 9. Ta Time Series Data in HBase ke 2 Colu mn Key foo 1234567890 1 foo 1234567892 3 metric name fool 1234567890 2 Metric name first in row key for data locality. Problem: can’t store the metric as text in row key due to space concerns
  • 10. Ta Time Series Data in HBase ke 3 Colu Separate mn Key Lookup Table: Key Value 0x1 1234567890 1 0x1 foo 0x1 1234567892 3 0x2 fool metric foo 0x1 ID 0x2 1234567890 2 fool 0x2 Use a separate table to assign unique IDs to metric names (and tags, not shown here). IDs give us a predictable length and achieve desired data locality.
  • 11. Ta Time Series Data in HBase ke 4 Colu mn +0 +2 Key 0x1 1234567890 1 3 0x1 1234567892 3 0x2 1234567890 2 Reduce the number of rows by storing multiple consecutive data points in the same row. Fewer rows = faster to seek to a specific row.
  • 12. Ta Time Series Data in HBase ke 4 Colu mn +0 +2 Key 0x1 1234567890 1 3 Misleading table 0x1 1234567892 3 representation 0x2 1234567890 2 Gotcha #1: wider rows don’t save any space* Key Colum Value le 0x1 1234567890 n +0 1 ab l t d 0x1 1234567890 ua re +2 3 * Until magic prefix ct to +0 2 compression happens in A s 0x2 1234567890 upcoming HBase 0.94
  • 13. Ta Time Series Data in HBase ke 4 Colu mn +0 +2 Key 0x1 1234567890 1 3 0x1 1234567892 3 0x2 1234567890 2 Devil is in the details: when to start new rows? Naive answer: start on first data point, after some time start a new row.
  • 14. Ta Time Series Data in HBase ke 4 Colu mn +0 Key 0x1 1000000000 1 0000 00 1 TSD1 1000 First data point: foo Start a new row Client TSD2
  • 15. Ta Time Series Data in HBase ke 4 Colu mn +0 +10 ... Key 0x1 1000000000 1 2 ... 0000 10 2 TSD1 1000 Keep adding foo points until... Client TSD2
  • 16. Ta Time Series Data in HBase ke 4 Colu mn +0 +10 ... +599 Key 0x1 1000000000 1 2 ... 42 42 0000 0599 TSD1 ... some arbitrary fo o 10 limit, say 10min Client TSD2
  • 17. Ta Time Series Data in HBase ke 4 Colu mn +0 +10 ... +599 Key 0x1 1000000000 1 2 ... 42 0x1 1000000600 51 51 0000 0610 TSD1 Then start a new fo o 10 row Client TSD2
  • 18. Ta Time Series Data in HBase ke 4 Colu mn +0 Key 0x1 1234567890 1 But this scheme fails with multiple TSDs 5678 90 1 TSD1 Create new row foo 1234 Client TSD2
  • 19. Ta Time Series Data in HBase ke 4 Colu mn +0 +2 Key 0x1 1234567890 1 3 5678 92 3 TSD1 Add to row foo 1234 Client TSD2
  • 20. Ta Time Series Data in HBase ke 4 Colu mn +0 +2 Key 0x1 1234567890 1 3 Oops! 0x1 1234567892 3 Maybe a connection failure occurred, client is retransmitting data to another TSD TSD1 Add to row foo 12345678 92 3 Client TSD2 Create new row
  • 21. Ta Time Series Data in HBase ke 5 Colu mn +90 +92 Key Base timestamp 0x1 1234567800 1 3 always a multiple of 0x2 1234567800 2 600 In order to scale easily and keep TSD stateless, make writes independent & idempotent. New rule: rows are aligned on 10 min. boundaries
  • 22. Ta Time Series Data in HBase ke 6 Colu mn +1890 +1892 Key Base timestamp 0x1 1234566000 1 3 always a multiple of 0x2 1234566000 2 3600 1 data point every ~10s => 60 data points / row Not much. Go to wider rows to further increase seek speed. One hour rows = 6x fewer rows
  • 23. Ta Time Series Data in HBase ke 6 Colu mn +1890 +1892 Key 0x1 1234566000 1 3 0x2 1234566000 2 Remember: wider rows don’t save any space! Key Colum Value Key is easily 4x le 0x1 1234566000 n +1890 1 bigger than tab column + value al ed 0x1 1234566000 tu or +1892 3 Ac st 0x2 1234566000 +1890 2 and repeated
  • 24. Ta Time Series Data in HBase ke 7 Colu mn +1890 +1890 +1892 +1892 Key 0x1 1234566000 1 1 3 3 0x2 1234566000 2 Solution: “compact” columns by concatenation Key Column Value Space savings le 0x1 1234566000 +1890 1 on disk and in tab al ed 0x1 tu or 1234566000 +1890,+1892 1, 3 memory are Ac st 0x1 1234566000 +1892 3 huge: data is 0x2 1234566000 +1890 2 4x-8x smaller!
  • 25. ¿ Questions ? ub tH Gi on opentsdb.net e m kr Fo Summary • Use asynchbase • Use Netty or Finagle • Wider table > Taller table • Short family names • Make writes idempotent • Make writes independent • Compact your data • Have predictable key sizes ool? Thin k this is c Benoît “tsuna” Sigoure W e’re hiring tsuna@stumbleupon.com