- 一致性(Consistency) (全部節點在同一時間具備相同的數據) html
- 可用性(Availability) (保證每個請求無論成功或者失敗都有響應) node
- 分隔容忍(Partition tolerance) (系統中任意信息的丟失或失敗不會影響系統的繼續運做)git
Denormalization, Duplication, and Intelligent Keys (DDI)github
關於HBase URL Shortener示例的一些擴展閱讀:
https://github.com/michiard/CLOUDS-LAB/tree/master/hbase-lab算法
The support for sparse, wide tables and column-oriented design often eliminates the need to normalize data and, in the process, the costly JOINoperations needed to aggregatethe data at query time. Use of intelligent keys gives you fine-grained control over how—and where—data is stored. Partial key lookups are possible, and when combined with compound keys, they have the same properties as leading, left-edge indexes. Designing the schemas properly enables you to grow the data from 10 entries to 10 million entries, while still retaining the same write and read performance. shell
稀疏 sparse,wide tables,是反範式的數據庫
這一篇能夠看網絡
bigtable: 丟棄傳統的RDBMS的CRU特性,追求更高效適應水平分佈擴展需求的支持數據段掃描及全表掃描的分佈式數據庫app
HBASE元素:ROW,ROWKEY,COLUMN,COLUMN FAMILY,CELL負載均衡
HBASE的天然排序:HBASE是以lexicographically排序的即詞典式的排序,按字節碼排序
HBASE是支持二級索引的!但BIG TABLE不支持。
HBASE的COLUMN FAMILY須預先定義而且最好不該常常變成,數量上也最好要少於10個,不要太多(思考:難道是由於是sparse, wide,因此最好不要有太多空白列?),不過一個column family你儘管能夠擁有上百萬的column,由於它們佔用的是行而非列。Timestamp可由系統指定也可由用戶指定。
Predicate deletion => Log-structured Merge-Tree/LSM
HFile是按column family存儲的,即一個column family佔用一個HFile,爲了更容易in-memory store
HBASE和BIGTABLE的「正統」用法是WEB TABLE啊.. 專用於爬蟲的,好比保存anchor, content等
HBASE中的REGION至關於自動分片(auto - sharding)
For HBase and modern hardware, the number would be more like 10 to 1,000 regions per server, but each between 1 GB and 2 GB in size
RegionServer管理近千個regions,理論上每一個row只存在於一個region(問,若是一個row超過了一個region,如何處理的? 咱們是否是不該該設計這樣的rowkey先?)
Single-row transaction:一行的數據是事務性原子性的,無跨行原子性
Map-Reduce可將HBASE數據轉化爲inputFormat和outputFormat
HFile有block,block又導致必須得有block index lookup,這個index保存在內存中(in-memory block index)
Zookeeper是Chubby for bigtable的對應物,
It offers filesystem-like access with directories and files (called znodes) that distributed systems can use to negotiate ownership, register services, or watch for updates. Every region server creates its own ephemeral node in ZooKeeper, which the master, in turn, uses to discover available servers. They are also used to track server failures or network partitions.
master (HMaster) 會作
- Zookeeper (問:Zookeeper和HMaster分別作什麼?書中P26語焉不詳)
- 負載均衡管理
- 監控和管理schema changes, metadata operations,如表/列族的建立等
- Zookeeper仍然使用heartbeating機制
Region server
- 作region split (sharding)
- 作region管理
Client直接與regions交互讀寫數據,region server並不參與
這兒徹底不懂(P27): 涉及到表掃描算法
Table scans run in linear time and row key lookups or mutations are performed in logarithmic order—or, in extreme cases, even constant order (using Bloom filters). Designing the schema in a way to completely avoid explicit locking, combined with row-level atomicity, gives you the ability to scale your system without any notable effect on read or write performance.
何謂read-modify-write? wiki
In computer science, read–modify–write is a class of atomic operations such as test-and-set, fetch-and-add, and compare-and-swap which both read a memory location and write a new value into it simultaneously, either with a completely new value or some function of the previous value. These operations prevent race conditions in multi-threaded applications. Typically they are used to implement mutexes or semaphores. These atomic operations are also heavily used in non-blocking synchronization.
3.疑惑: