- 一致性(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.疑惑: