Upgrade to Pro — share decks privately, control downloads, hide ads and more …

HBase_intro

Avatar for infinitejean infinitejean
August 01, 2012
120

 HBase_intro

Avatar for infinitejean

infinitejean

August 01, 2012
Tweet

Transcript

  1. Introduction to HBase HBase 是具有以下特點的儲存系統: - 類似表格的資料結構 (Multi-Dimensional Map) -

    分散性 (Distributed storage) - 高可用性、高效能 (High availability, High performance) - 很容易擴充容量及效能 (Horizontal scalability) HBase 適用於數以千計的⼀一般伺服器上,來儲存 Petabytes 級的資料 HBase 以 Hadoop 分散式檔案系統 (HDFS) 為基 礎,提供類似 Google Bigtable 功能 HBase 同時提供 Hadoop MapReduce 程式設計 4 12年8月1日星期三
  2. HBase is (not) ... 不是關聯式 (Relational) 資料庫系統 - column-oriented 只有⼀一個主要索引

    (primary index) 即 row key 不提供 Join (use MapReduce) 不提供 SQL 語法 Basic operation : - Get - Put - Scan 5 12年8月1日星期三
  3. Why HBase ? Bigtable 關聯式資料庫 (Relational Database) 適合用做資料異動的操作, 主要因為這動作在記憶體中進行。但對於大量的資料分析,資料分 散在多個節點的情況下,關聯式資料庫系統就不適用了。

    大量資料分析: - Big queries - 整個資料表的存取 - Big databases - 100 Terabytes 以上的資料 HBase HBase 實作 Bigtable 的概念,且為 open source ! 架構在 Hadoop HDFS 上 HBase 是 Apache 的專案之⼀一,在支援及維護上較有保障 6 12年8月1日星期三
  4. Data Model Table 依 row key 字典排序 Table schema 只要定義

    column families Column = Column Family : Column Qualifier Column 可動態新增,每個 row 可有不同數量的 columns byte[] 是唯⼀一的資料型態 (Row, Family: Column, Timestamp) -> Value Row Key TimeStamp Column Family “Content:” Column Family “Anchor:” Column Family “Anchor:” com.cnn.www t9 “<html>...” “cnnsi.com” “CNN” com.cnn.www t8 “cnnsi.com” “CNN” com.cnn.www t7 “my.look.ca” “MyLook” com.cnn.www t6 “<html>...” 10 12年8月1日星期三
  5. Study Case - Blog Logical data model - ⼀一篇 Blog

    entry 由 title, date, author, type, text 欄位所組成 - ⼀一位 User 由 username, password 等欄位所組成 - 每⼀一篇的 Blog entry 可有許多 Comments,每⼀一則 comment 由 title, author 與 text 組成 ERD 11 12年8月1日星期三
  6. HBase Table Schema Row key - type (以二個字元的縮寫代表)與 timestamp 組合而成

    - 因為 rows 會先後依 type 及 timestamp 排序好。方便用 scan() 來存取 table 的資料 BLOGENTRY 與 COMMENT 的“⼀一對多”關係由 comment_title, comment_author, comment_text 等 column families 內的動態數量的 column 來表示。每個 column 的名稱是由每則 comment 的 timestamp 來表示,因此每個 column family 的 column 會依時間自動排序好 12 12年8月1日星期三
  7. Region 表格是由⼀一或多個 region 所構成 ( region = startKey + endKey)

    每個 region 可能會存 在於多個不同節點上, 而且是由數個 HDFS 檔 案與區塊所構成,這類 region 是由 Hadoop 負責複製 14 12年8月1日星期三
  8. Member HBase Master - 負責管理 region servers - 適度分配 regions

    給 region servers - 負責處理使用者的查詢,並提供資料所在的 region server 資訊 Region Servers - 負責處理使用者的 request (write/read/scan) - 定時送 heartbeat 給 master - 增加 region servers 將可增加整體的 throughput 16 12年8月1日星期三
  9. Operation The Root table holds the list of .META. table

    regions The .META. table holds the list of all user- space regions 17 12年8月1日星期三
  10. Reference - HBase wiki http://wiki.apache.org/hadoop/Hbase/DataModel - 趨勢科技 http://www.trend.com.tw/program/3rd/Introduction%20to%20HBase.zip - 國網中心

    http://trac.nchc.org.tw/cloud/browser - http://www.cs.brown.edu/courses/csci2270/slides/mar14-hbase.pdf 18 12年8月1日星期三