68
The State of Apache HBase Michael Stack

Michael stack -the state of apache h base

Embed Size (px)

DESCRIPTION

BDTC 2013 Beijing China

Citation preview

Page 1: Michael stack -the state of apache h base

The State of Apache HBaseMichael Stack

Page 2: Michael stack -the state of apache h base

[email protected]

* Project Management Committee

●PMC* Chair of Apache HBase Project ●Caretaker/Janitor

●Member of the Hadoop PMC●Engineer at Cloudera in San Francisco

Page 3: Michael stack -the state of apache h base

Table of Contents:●What is HBase?●Who uses it?●Who runs the project?●HBase Today●Tomorrow●Ecosystem

Page 4: Michael stack -the state of apache h base

HBase is... ”...an open source, distributed, scalable, consistent, low latency, non-relational, random access database”

Page 5: Michael stack -the state of apache h base

Built on Apache Hadoop

● Hadoop core is:– Distributed file system (HDFS)– MapReduce

● HBase persists all data to HDFS● Uses Apache ZooKeeper

– Cluster coordination

Page 6: Michael stack -the state of apache h base

“Billions of rows X millions of columns on clusters of 'commodity hardware'”

http://www.flickr.com/photos/ag_gilmore/8170021483/in/photostream/

Project Goal:

Page 7: Michael stack -the state of apache h base

InspirationA Google Technology described in a 2006 paper, Bigtable: A Distributed Storage System for Structured Data by Chang et al.?

Page 8: Michael stack -the state of apache h base

First commit...

commit 454a9dbe046194f8eef3dddc3e5942910dd5b7a1Author: Douglass Cutting <[email protected]>Date: Tue Apr 3 20:34:28 2007 +0000

HADOOP-1045. Add contrib/hbase, a BigTable-like online database.

Page 9: Michael stack -the state of apache h base

HADOOPDISTRIBUTIONS

Page 10: Michael stack -the state of apache h base

When to use it?

Page 11: Michael stack -the state of apache h base

BIG data

Page 12: Michael stack -the state of apache h base

scalE!

Page 13: Michael stack -the state of apache h base

Low-latency, online, random read/writes+ “Simple” access patterns

Page 14: Michael stack -the state of apache h base

*Like Google Bigtable model only different nomenclature

Datamodel*

Page 15: Michael stack -the state of apache h base

DataModel: A Bigtable!●0-N Bigtable(s)●Bigtable has:

●Rows x Column Families●Rows have primary key

●Column Families have:●Any number of Columns●By access/attributes●CF prefix and qualifier

● e.g. attribute:mimetype

Bigtable A

abcdefghi

k

m

o

j

l

p

srq

t

n

uvwxyz

aabbcc

Colum n Family A Column Family BRow Key

= Cell @ bigtable 'A', row key 'p', CF 'B:red'

Page 16: Michael stack -the state of apache h base

Datamodel: Regions●Bigtable splits into “regions”

●Automatically as table grows●Region has contiguous rows

●Known by [startRow, endRow)●Distributed over cluster

●0-100s per server c

e

abcd

fghij

lmno

k

Region a-e

Region e-j

Region k-o

Etc.

Page 17: Michael stack -the state of apache h base

DataModel: Sorted & Versioned●All is byte []

●No native 'types'●Minor schema or schema-less (NoSQL)

●All is SORTED●Rows in byte-lexicographical order●Columns sorted along row

●VERSIONED●Cells are “versioned”●3D (timestamp)

Region a-e3D

cde

cd

bcde

bcd

a

e

bcd

cde

cd

bcde

bcd

a

e

bcd

cde

cd

bcde

bcd

a

e

bcd

Page 18: Michael stack -the state of apache h base

Datamodel: Strongly consistent

●Favors consistency over availability“Designing applications to cope with concurrency anomalies in their data is very error-prone, time-consuming, and ultimately not worth the performance gains” -- F1: A Distributed SQL Database That Scales

●Row modifications are atomic●Even if thousands of columns on a row

Page 19: Michael stack -the state of apache h base

Datamodel: in short ”...a sparse, distributed, persistent

multidimensional sorted map” – Bigtable Paper (2006)

(Table,  Row, ColumnFamily, Qualifer, Timestamp)   → Value

Page 20: Michael stack -the state of apache h base

Architecture: Birds-eye viewApplication MapReduce Impala

Thrift/REST Gateway

HBase Java Client

ZooKeeperHBase Master

HBase RegionServer

HDFS

Page 21: Michael stack -the state of apache h base

Features•Classes to MapReduce HBase tables

– HIVE, PIG, etc.

•Query predicate push down via server side filters •Coprocessors (stored procedures/triggers)

– e.g. security, secondary indices

•Java clients– REST and thrift too

•Extensible jruby-based (JIRB) shell•Replication•Security

– Table/Column Family– Kerberos Authentication, ACLs

Page 22: Michael stack -the state of apache h base

API●get●put●delete●multi●scan●increment●append●checkAnd*●MapReduce

Page 23: Michael stack -the state of apache h base

What to expect• Writes:

– 1-3ms, 1k-20k writes/sec per node

• Reads:– 0-3ms cached, 10-30ms disk– 10-40k reads / second / node from cache– > if SSD

• Cell size• 0-3MB preferred

• Column-orientated so wide tables are OK• Sparsely populated rows OK

Page 24: Michael stack -the state of apache h base

Who uses it?

Page 25: Michael stack -the state of apache h base
Page 26: Michael stack -the state of apache h base

In Production

Page 27: Michael stack -the state of apache h base

● OLTP & Batch● Messages○ 1B+ users○ Tens of PBs (compressed)○ Thousands of machines, Pods of ~200

● ODS/Real-time monitoring/Timeseries○ Metrics from every server @ FB○ 2.5B writes/16k reads per minute

● Post Search Store○ MapReduce to build index○ 1 Trillion posts

Page 28: Michael stack -the state of apache h base

● All on AWS● 5 production clusters and growing● Mix of SSD and SATA● Billions of page views per month

Page 29: Michael stack -the state of apache h base

● Long time HBase user● Two clusters of 1k nodes each

○ Master-Master replicating● Separate low-latency cluster

○ Up to 1M reads a second

Page 30: Michael stack -the state of apache h base

Cassini● Ebay item search indexing● 600M active items in HBase tables● 1.4TB of data processed each day● 400M puts to HBase each day● 250M search metrics per day● Two datacenters● Growing clusters...

– 500->1k

Page 31: Michael stack -the state of apache h base

Deploy types• Multitenant multifarious feature storeo a.k.a dumping groundo Stumbleupon, Y!, SalesForce

• Reconciliation storeo ebay

• Timeserieso SalesForce, FB ODS

• Lots-o-entities storeo Flurry, genomeo Lots-o-entities BLOBs, FB Messages

Page 32: Michael stack -the state of apache h base

Who runs the project?

Page 33: Michael stack -the state of apache h base

Diverse team*

* http://hbase.apache.org/team-list.html

COMMITTERS!

Preferably ALIVE!

Page 34: Michael stack -the state of apache h base

Dev Rate

Page 35: Michael stack -the state of apache h base

# of commitsTotal Files 2021Total Lines of Code 832122Total Commits 6615 (~ 3/day)Authors 39

(https://www.ohloh.net/p/hbase)

Page 36: Michael stack -the state of apache h base

JIRA: 2008-2013

Page 37: Michael stack -the state of apache h base

Commits/Month Over Time (0.94/trunk)

Page 38: Michael stack -the state of apache h base

HBase Today

Page 39: Michael stack -the state of apache h base
Page 40: Michael stack -the state of apache h base

•Release every month• Each more stable•& more performant•Some features…• Wire compatible between releases

•Currently at 0.94.13

Page 41: Michael stack -the state of apache h base

http://www.flickr.com/photos/sysli/3026288256/sizes/o/in/photostream/

Page 42: Michael stack -the state of apache h base

● hbase-0.96.0–Released October 19th, 2013– 18months in the making

● >2000 fixes

Page 43: Michael stack -the state of apache h base

Big Themes● Stability● Operability

–Insight, tools● Scalability● Evolvability

Page 44: Michael stack -the state of apache h base

● Pluggable Compaction– Smarter triggers

● Hadoop1 AND Hadoop2● Smarter Region Balancer● Region Assignment & Replication

– Hardened

● Coprocessors– More hooks

Sampler

Page 45: Michael stack -the state of apache h base

http://www.flickr.com/photos/allspaw/5815258929/sizes/o/in/photostream/

Page 46: Michael stack -the state of apache h base

http://www.flickr.com/photos/38595542@N02/3690830720/sizes/o/in/photostream/

Page 47: Michael stack -the state of apache h base
Page 48: Michael stack -the state of apache h base
Page 49: Michael stack -the state of apache h base

•System tables• Filesystem•Up in zookeeper•Over the wire

Page 50: Michael stack -the state of apache h base

Snapshots• By TableoSnapshot, clone, restore, export

• InexpensiveoJust metadata

• Good for...oBackupsoReplicationoOffline processing

Page 51: Michael stack -the state of apache h base

Namespaces• Grouping of tables

– Like database in mysql

• System/User– hbase:meta

• Quota• Coming

– Security by namespace– Grouping on cluster by namespace

Page 52: Michael stack -the state of apache h base

And more...• X-row (in-region) Transactions• Query tracing• New UI• Online Region Merge• Client-side types• Metrics2o Radical revamp

• Windows!

Page 53: Michael stack -the state of apache h base
Page 54: Michael stack -the state of apache h base

• Branched, released soon• Rolling upgrade from 0.96.0

• In-line Cell-tags– Security++

● ACL down to the Cell-level● Cell-level visibility labels● Encryption

• Reverse Scan

Page 55: Michael stack -the state of apache h base

●HBase 1.0.0●Reining in the 99th percentiles

●Multi-WAL●Speculative replica reads

●More support for multi-tenancy●Off-heap

HBase 2014

Page 56: Michael stack -the state of apache h base

Ecosystem

Page 57: Michael stack -the state of apache h base

OpenTSDB● Timeseries● Store, index and serve metrics at large scale● Make data easily accessible and graphable

Page 58: Michael stack -the state of apache h base

HaeinsaHaeinsa 란 무엇인가 ?

Is a linearly scalable multi-row, multi-table transaction library for HBase. Haeinsa uses two-phase locking and optimistic concurrency control for implementing transaction. The isolation level of transaction is serializable.

● Inspired by Google Percolator● VCNC

Page 59: Michael stack -the state of apache h base

Chasm

Page 60: Michael stack -the state of apache h base
Page 61: Michael stack -the state of apache h base

How to make it easier writing applications against HBase?

Page 62: Michael stack -the state of apache h base

Frameworks: Kiji.org

• Entity-centric, simple modelo Types, complex, compound types.

• Each cell is schema versioned

• Works across MR & REST, etc.

• Machine-learning libs

• Examples, tutorials

• Production users

• Open-source

Page 63: Michael stack -the state of apache h base

Frameworks: CDK• APIs providing Dataset abstraction

– get/put/delete API in AVRO objects

• Highlights: – Supports multiple components

● flume, morphlines, hive, crunch, hcat – Types using Avro and parquet formats– Manages schema evolution

• Open source by Cloudera – http://cloudera.github.io/cdk/docs/current

Page 64: Michael stack -the state of apache h base
Page 65: Michael stack -the state of apache h base

● Client-embedded JDBC driver○ Connection conn =

DriverManager.getConnection("jdbc:phoenix:localhost");

● Alternate HBase Client API (SQL)● Fast!

○ Exploits HBase Coprocessors/Filters○ Types○ Aggregations○ Skip scans○ Secondary indices

Page 66: Michael stack -the state of apache h base

+ + etcDatastores

Page 67: Michael stack -the state of apache h base

Thank [email protected]

End

Page 68: Michael stack -the state of apache h base

TODO

● DBA: R (read), W (write), C (create), X (execute), A (admin). ● cell-level security. Every cell in an Accumulo store can have a label, stored effectively as part of

the key, which is used to determine whether a value is visible to a given subject or not. The label is not an ACL, it is a different way of expressing security policy.

● A label instead turns this on its head and describes the sensitivity of the information to a decision engine that then figures out if the subject is authorized to view data of that sensitivity based on (potentially, many) factors.

● Then, as of HBASE-7662, HBase can store into and apply ACLs from cell tags, extending the current HBase ACL model down to the cell.

● Finally, we have also contributed transparent server side encryption, as HBASE-7544, for additional assurance against accidental leakage of data at rest, which is at this time an HBase-only feature.

● Auto-manages partitioning● Storage machinery in the RS● I like the Latency/Throughput/Read/Write axis in Nick