SlideShare a Scribd company logo
Intro to HBase
                      Alex Baranau, Sematext International, 2012




Monday, July 9, 12
About Me


                     Software Engineer at Sematext International

                     http://blog.sematext.com/author/abaranau

                     @abaranau

                     http://github.com/sematext (abaranau)




Monday, July 9, 12
Agenda


                     What is HBase?

                     How to use HBase?

                     When to use HBase?




Monday, July 9, 12
What is HBase?




Monday, July 9, 12
What: HBase is...
                     Open-source non-relational distributed
                     column-oriented database modeled after
                     Google’s BigTable.


                       Think of it as a sparse, consistent,
                       distributed, multidimensional, sorted map:

                         labeled tables of rows

                         row consist of key-value cells:

       (row key, column family, column, timestamp) -> value


Monday, July 9, 12
What HBase is NOT
                     Not an SQL database

                     Not relational

                     No joins

                     No fancy query language and no
                     sophisticated query engine

                     No transactions out-of-the box

                     No secondary indices out-of-the box

                     Not a drop-in replacement for your RDBMS


Monday, July 9, 12
What: Features-1

                     Linear scalability, capable of
                     storing hundreds of terabytes of data

                     Automatic and configurable sharding
                     of tables

                     Automatic failover support

                     Strictly consistent reads and writes



Monday, July 9, 12
What: Part of Hadoop
                                 ecosystem

                        Provides realtime random read/write
                        access to data stored in HDFS



                                read          HBase           write

                       Data            read           write             Data
                     Consumer                                         Producer
                                              HDFS            write



Monday, July 9, 12
What: Features-2
                     Integrates nicely with Hadoop MapReduce (both
                     as source and destination)

                     Easy Java API for client access

                     Thrift gateway and REST APIs

                     Bulk import of large amount of data

                     Replication across clusters & backup options

                     Block cache and Bloom filters for real-time
                     queries

                     and many more...



Monday, July 9, 12
How to use HBase?




Monday, July 9, 12
How: the Data
                         Row keys uninterpreted byte arrays

                         Columns grouped in columnfamilies (CFs)

                         CFs defined statically upon table creation

                         Cell is uninterpreted byte array and a timestamp
   Rows are ordered
                                   Different data                    All values stores as
    and accessed by
                                 separated into CFs                      byte arrays
        row key

                       Row Key                                Data
                                                                                            Rows can have
                                         geo:{‘country’:‘Belarus’,‘region’:‘Minsk’}           different
                         Minsk
                                       demography:{‘population’:‘1,937,000’@ts=2011}           columns


                                            geo:{‘country’:‘USA’,‘state’:’NY’}              Cell can have
                     New_York_City     demography:{‘population’:‘8,175,133’@ts=2010,          multiple
                                              ‘population’:‘8,244,910’@ts=2011}               versions

                                                                                             Data can be
                         Suva                         geo:{‘country’:‘Fiji’}
                                                                                            very “sparse”
Monday, July 9, 12
How: Writing the Data
                      Row updates are atomic

                      Updates across multiple rows are NOT
                      atomic, no transaction support out of
                      the box

                      HBase stores N versions of a cell
                      (default 3)

                      Tables are usually “sparse”, not all
                      columns populated in a row


Monday, July 9, 12
How: Reading the Data
                      Reader will always read the last written (and committed)
                      values

                      Reading single row: Get

                      Reading multiple rows: Scan (very fast)

                         Scan usually defines start key and stop key

                         Rows are ordered, easy to do partial key scan

                                   Row Key                  Data
                       ‘login_2012-03-01.00:09:17’    d:{‘user’:‘alex’}
                                     ...                     ...
                       ‘login_2012-03-01.23:59:35’    d:{‘user’:‘otis’}
                       ‘login_2012-03-02.00:00:21’   d:{‘user’:‘david’}


                      Query predicate pushed down via server-side Filters


Monday, July 9, 12
How: MapReduce Integration
                     Out of the box integration with Hadoop
                     MapReduce

                       Data from HBase table can be source
                       for MR job

                       MR job can write data into HBase

                       MR job can write data into HDFS
                       directly and then output files can be
                       very quickly loaded into HBase via
                       “Bulk Loading” functionality


Monday, July 9, 12
How: Sharding the Data
                      Automatic and configurable sharding of
                      tables:

                        Tables partitioned into Regions

                        Region defined by start & end row keys

                        Regions are the “atoms” of
                        distribution

                      Regions are assigned to RegionServers
                      (HBase cluster slaves)



Monday, July 9, 12
How: Setup: Components
                      HBase components


                                              ZooKeeper
                                              ZooKeeper
                                               ZooKeeper


                      client             HMaster
                                          HMaster


                                         RegionServer

                               RegionServer    RegionServer
                                                RegionServer
                                                 RegionServer


Monday, July 9, 12
How: Setup: Hadoop Cluster
                         Typical Hadoop+HBase setup
                                                     Master Node                  HDFS

                                 NameNode      JobTracker                        MapReduce

                                                                                  HBase
                                           HMaster


                         RegionServer         RegionServer                         Slave




                                                                   TaskTracker
           TaskTracker




                                                                                   Nodes

                           DataNode             DataNode



                              Slave Node                     Slave Node
Monday, July 9, 12
How: Setup: Automatic Failover

                     DataNode failures handled by HDFS
                     (replication)

                     RSs failures (incl. caused by whole
                     server failure) handled automatically

                       Master re-assignes Regions to
                       available RSs

                     HMaster failover: automatic with
                     multiple HMasters


Monday, July 9, 12
When to Use HBase?




Monday, July 9, 12
When: What HBase is good at

                     Serving large amount of data: built
                     to scale from the get-go

                     fast random access to the data

                     Write-heavy applications*

                     Append-style writing (inserting/
                     overwriting new data) rather than
                     heavy read-modify-write operations**

      * clients should handle the loss of HTable client-side buffer
      ** see https://github.com/sematext/HBaseHUT


Monday, July 9, 12
When: HBase vs ...


                     Favors consistency over availability

                     Part of a Hadoop ecosystem

                     Great community; adopted by tech
                     giants like Facebook, Twitter,
                     Yahoo!, Adobe, etc.




Monday, July 9, 12
When: Use-cases
                     Audit logging systems

                       track user actions

                       answer questions/queries like:

                         what are the last 10 actions made by
                         user?
                         row key: userId_timestamp

                         which users logged into system
                         yesterday?
                         row key: action_timestamp_userId


Monday, July 9, 12
When: Use-cases

                     Real-time analytics, OLAP

                       real-time counters

                       interactive reports showing
                       trends, breakdowns, etc

                       time-series databases




Monday, July 9, 12
When: Use-cases
                     Monitoring system example




Monday, July 9, 12
When: Use-cases
                     Messages-centered systems

                       twitter-like messages/statuses

                     Content management systems

                       serving content out of HBase

                     Canonical use-case: webtable (pages
                     stored during crawling the web)

                     And others


Monday, July 9, 12
Future


                     Making stable enough to substitute
                     RDBMS in mission critical cases

                     Easier system management

                     Performance improvements




Monday, July 9, 12
Qs?
                     (next: Intro into HBase Internals)




                            Sematext is hiring!
Monday, July 9, 12

More Related Content

What's hot (20)

PDF
Introduction to MongoDB
Mike Dirolf
 
PPTX
HBase and HDFS: Understanding FileSystem Usage in HBase
enissoz
 
PDF
Hadoop Overview & Architecture
EMC
 
PPTX
Apache Tez: Accelerating Hadoop Query Processing
DataWorks Summit
 
PPTX
Hive Tutorial | Hive Architecture | Hive Tutorial For Beginners | Hive In Had...
Simplilearn
 
PPTX
Hive + Tez: A Performance Deep Dive
DataWorks Summit
 
PDF
Facebook Messages & HBase
强 王
 
PDF
Apache Flume
Arinto Murdopo
 
PPTX
Apache Hive
tusharsinghal58
 
PPTX
Performance Optimizations in Apache Impala
Cloudera, Inc.
 
PDF
HDFS Architecture
Jeff Hammerbacher
 
PDF
Scalability, Availability & Stability Patterns
Jonas Bonér
 
PPTX
Hive 3 - a new horizon
Thejas Nair
 
PDF
Spark (v1.3) - Présentation (Français)
Alexis Seigneurin
 
PDF
HBase replication
wchevreuil
 
PPT
Hadoop Security Architecture
Owen O'Malley
 
PPT
Hive(ppt)
Abhinav Tyagi
 
PPTX
Hadoop World 2011: Advanced HBase Schema Design - Lars George, Cloudera
Cloudera, Inc.
 
PPTX
Introduction to Redis
Arnab Mitra
 
PPTX
Apache HBase™
Prashant Gupta
 
Introduction to MongoDB
Mike Dirolf
 
HBase and HDFS: Understanding FileSystem Usage in HBase
enissoz
 
Hadoop Overview & Architecture
EMC
 
Apache Tez: Accelerating Hadoop Query Processing
DataWorks Summit
 
Hive Tutorial | Hive Architecture | Hive Tutorial For Beginners | Hive In Had...
Simplilearn
 
Hive + Tez: A Performance Deep Dive
DataWorks Summit
 
Facebook Messages & HBase
强 王
 
Apache Flume
Arinto Murdopo
 
Apache Hive
tusharsinghal58
 
Performance Optimizations in Apache Impala
Cloudera, Inc.
 
HDFS Architecture
Jeff Hammerbacher
 
Scalability, Availability & Stability Patterns
Jonas Bonér
 
Hive 3 - a new horizon
Thejas Nair
 
Spark (v1.3) - Présentation (Français)
Alexis Seigneurin
 
HBase replication
wchevreuil
 
Hadoop Security Architecture
Owen O'Malley
 
Hive(ppt)
Abhinav Tyagi
 
Hadoop World 2011: Advanced HBase Schema Design - Lars George, Cloudera
Cloudera, Inc.
 
Introduction to Redis
Arnab Mitra
 
Apache HBase™
Prashant Gupta
 

Similar to Intro to HBase (20)

PPTX
01 hbase
Subhas Kumar Ghosh
 
PPTX
Hbase
AmitkumarPal21
 
PDF
Intro to HBase - Lars George
JAX London
 
PPTX
HBase Introduction
Hanborq Inc.
 
PDF
Nyc hadoop meetup introduction to h base
智杰 付
 
PDF
Apache HBase: Introduction to a column-oriented data store
Christian Gügi
 
PPTX
HBase in Practice
DataWorks Summit/Hadoop Summit
 
PDF
HBase Advanced - Lars George
JAX London
 
PDF
Intro to HBase Internals & Schema Design (for HBase users)
alexbaranau
 
PPTX
HBase in Practice
larsgeorge
 
PDF
Apachecon Europe 2012: Operating HBase - Things you need to know
Christian Gügi
 
PDF
Uint-5 Big data Frameworks.pdf
Sitamarhi Institute of Technology
 
PPTX
HBase Tutorial For Beginners | HBase Architecture | HBase Tutorial | Hadoop T...
Simplilearn
 
PDF
training huawei big data for data engineer
EricSandria2
 
PDF
NoSQL HBase schema design and SQL with Apache Drill
Carol McDonald
 
PDF
Hbase schema design and sizing apache-con europe - nov 2012
Chris Huang
 
PPT
HBASE Overview
Sampath Rachakonda
 
PPTX
TriHUG January 2012 Talk by Chris Shain
trihug
 
PPTX
HBase.pptx
Sadhik7
 
PPTX
Introduction to Apache HBase
Gokuldas Pillai
 
Intro to HBase - Lars George
JAX London
 
HBase Introduction
Hanborq Inc.
 
Nyc hadoop meetup introduction to h base
智杰 付
 
Apache HBase: Introduction to a column-oriented data store
Christian Gügi
 
HBase in Practice
DataWorks Summit/Hadoop Summit
 
HBase Advanced - Lars George
JAX London
 
Intro to HBase Internals & Schema Design (for HBase users)
alexbaranau
 
HBase in Practice
larsgeorge
 
Apachecon Europe 2012: Operating HBase - Things you need to know
Christian Gügi
 
Uint-5 Big data Frameworks.pdf
Sitamarhi Institute of Technology
 
HBase Tutorial For Beginners | HBase Architecture | HBase Tutorial | Hadoop T...
Simplilearn
 
training huawei big data for data engineer
EricSandria2
 
NoSQL HBase schema design and SQL with Apache Drill
Carol McDonald
 
Hbase schema design and sizing apache-con europe - nov 2012
Chris Huang
 
HBASE Overview
Sampath Rachakonda
 
TriHUG January 2012 Talk by Chris Shain
trihug
 
HBase.pptx
Sadhik7
 
Introduction to Apache HBase
Gokuldas Pillai
 
Ad

Recently uploaded (20)

PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Digital Circuits, important subject in CS
contactparinay1
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Ad

Intro to HBase

  • 1. Intro to HBase Alex Baranau, Sematext International, 2012 Monday, July 9, 12
  • 2. About Me Software Engineer at Sematext International http://blog.sematext.com/author/abaranau @abaranau http://github.com/sematext (abaranau) Monday, July 9, 12
  • 3. Agenda What is HBase? How to use HBase? When to use HBase? Monday, July 9, 12
  • 5. What: HBase is... Open-source non-relational distributed column-oriented database modeled after Google’s BigTable. Think of it as a sparse, consistent, distributed, multidimensional, sorted map: labeled tables of rows row consist of key-value cells: (row key, column family, column, timestamp) -> value Monday, July 9, 12
  • 6. What HBase is NOT Not an SQL database Not relational No joins No fancy query language and no sophisticated query engine No transactions out-of-the box No secondary indices out-of-the box Not a drop-in replacement for your RDBMS Monday, July 9, 12
  • 7. What: Features-1 Linear scalability, capable of storing hundreds of terabytes of data Automatic and configurable sharding of tables Automatic failover support Strictly consistent reads and writes Monday, July 9, 12
  • 8. What: Part of Hadoop ecosystem Provides realtime random read/write access to data stored in HDFS read HBase write Data read write Data Consumer Producer HDFS write Monday, July 9, 12
  • 9. What: Features-2 Integrates nicely with Hadoop MapReduce (both as source and destination) Easy Java API for client access Thrift gateway and REST APIs Bulk import of large amount of data Replication across clusters & backup options Block cache and Bloom filters for real-time queries and many more... Monday, July 9, 12
  • 10. How to use HBase? Monday, July 9, 12
  • 11. How: the Data Row keys uninterpreted byte arrays Columns grouped in columnfamilies (CFs) CFs defined statically upon table creation Cell is uninterpreted byte array and a timestamp Rows are ordered Different data All values stores as and accessed by separated into CFs byte arrays row key Row Key Data Rows can have geo:{‘country’:‘Belarus’,‘region’:‘Minsk’} different Minsk demography:{‘population’:‘1,937,000’@ts=2011} columns geo:{‘country’:‘USA’,‘state’:’NY’} Cell can have New_York_City demography:{‘population’:‘8,175,133’@ts=2010, multiple ‘population’:‘8,244,910’@ts=2011} versions Data can be Suva geo:{‘country’:‘Fiji’} very “sparse” Monday, July 9, 12
  • 12. How: Writing the Data Row updates are atomic Updates across multiple rows are NOT atomic, no transaction support out of the box HBase stores N versions of a cell (default 3) Tables are usually “sparse”, not all columns populated in a row Monday, July 9, 12
  • 13. How: Reading the Data Reader will always read the last written (and committed) values Reading single row: Get Reading multiple rows: Scan (very fast) Scan usually defines start key and stop key Rows are ordered, easy to do partial key scan Row Key Data ‘login_2012-03-01.00:09:17’ d:{‘user’:‘alex’} ... ... ‘login_2012-03-01.23:59:35’ d:{‘user’:‘otis’} ‘login_2012-03-02.00:00:21’ d:{‘user’:‘david’} Query predicate pushed down via server-side Filters Monday, July 9, 12
  • 14. How: MapReduce Integration Out of the box integration with Hadoop MapReduce Data from HBase table can be source for MR job MR job can write data into HBase MR job can write data into HDFS directly and then output files can be very quickly loaded into HBase via “Bulk Loading” functionality Monday, July 9, 12
  • 15. How: Sharding the Data Automatic and configurable sharding of tables: Tables partitioned into Regions Region defined by start & end row keys Regions are the “atoms” of distribution Regions are assigned to RegionServers (HBase cluster slaves) Monday, July 9, 12
  • 16. How: Setup: Components HBase components ZooKeeper ZooKeeper ZooKeeper client HMaster HMaster RegionServer RegionServer RegionServer RegionServer RegionServer Monday, July 9, 12
  • 17. How: Setup: Hadoop Cluster Typical Hadoop+HBase setup Master Node HDFS NameNode JobTracker MapReduce HBase HMaster RegionServer RegionServer Slave TaskTracker TaskTracker Nodes DataNode DataNode Slave Node Slave Node Monday, July 9, 12
  • 18. How: Setup: Automatic Failover DataNode failures handled by HDFS (replication) RSs failures (incl. caused by whole server failure) handled automatically Master re-assignes Regions to available RSs HMaster failover: automatic with multiple HMasters Monday, July 9, 12
  • 19. When to Use HBase? Monday, July 9, 12
  • 20. When: What HBase is good at Serving large amount of data: built to scale from the get-go fast random access to the data Write-heavy applications* Append-style writing (inserting/ overwriting new data) rather than heavy read-modify-write operations** * clients should handle the loss of HTable client-side buffer ** see https://github.com/sematext/HBaseHUT Monday, July 9, 12
  • 21. When: HBase vs ... Favors consistency over availability Part of a Hadoop ecosystem Great community; adopted by tech giants like Facebook, Twitter, Yahoo!, Adobe, etc. Monday, July 9, 12
  • 22. When: Use-cases Audit logging systems track user actions answer questions/queries like: what are the last 10 actions made by user? row key: userId_timestamp which users logged into system yesterday? row key: action_timestamp_userId Monday, July 9, 12
  • 23. When: Use-cases Real-time analytics, OLAP real-time counters interactive reports showing trends, breakdowns, etc time-series databases Monday, July 9, 12
  • 24. When: Use-cases Monitoring system example Monday, July 9, 12
  • 25. When: Use-cases Messages-centered systems twitter-like messages/statuses Content management systems serving content out of HBase Canonical use-case: webtable (pages stored during crawling the web) And others Monday, July 9, 12
  • 26. Future Making stable enough to substitute RDBMS in mission critical cases Easier system management Performance improvements Monday, July 9, 12
  • 27. Qs? (next: Intro into HBase Internals) Sematext is hiring! Monday, July 9, 12