Apache HBase™ is the Hadoop database, a distributed, scalable, big data store.
#分布式 可扩展 大数据存储数据库
Use Apache HBase™ when you need random, realtime read/write access to your Big Data.
#随机的实时的大数据访问
This project's goal is the hosting of very large tables -- billions of rows X millions of columns --
#存储非常大的数据表
atop clusters of commodity hardware. Apache HBase is an open-source, distributed, versioned, non-relational database modeled after Google's Bigtable: A Distributed Storage System for Structured Data by Chang et al. Just as Bigtable leverages the distributed data storage provided by the Google File System, Apache HBase provides Bigtable-like capabilities on top of Hadoop and HDFS.
概念 | MySQL | Hbase |
---|---|---|
数据库 | DataBase | NameSpace |
数据表 | Table | Table【分布式的】 |
数据分区 | - | Region |
数据行 | 主键+其他列 | Rowkey+其他列 |
列族 | - | ColumnFamily |
数据列 | 普通列与对应的值 | 列【timestamp】与对应的值【支持多版本】 |
hbase shell
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-j3OUucRa-1627099407310)(20210316_分布式NoSQL列存储数据库Hbase(一).assets/image-20210316180046440.png)]
help
create_namespace 'itcast'
create 'itcast:heima',{NAME =>'cf1',VERSIONS=> 3},{NAME =>'cf2'}
#往itcast:heima表中的这一行20210301_001中插入一列cf1列族下,插入name这一列,列的值为laoda
put 表名 rowkey 列族:列 值
put 'itcast:heima','20210301_001','cf1:name','laoda'
put 'itcast:heima','20210301_001','cf1:age',20
put 'itcast:heima','20210301_001','cf2:phone','110'
put 'itcast:heima','20210201_002','cf1:name','laoer'
put 'itcast:heima','20210201_002','cf2:phone','120'
put 'itcast:heima','20210301_003','cf1:name','laosan'
scan 'itcast:heima'
创建Table
create 'itcast:heima',{NAME =>'cf1',VERSIONS=> 3},{NAME =>'cf2'}
#往itcast:heima表中的这一行20210301_001中插入一列cf1列族下,插入name这一列,列的值为laoda
put 表名 rowkey 列族:列 值
put 'itcast:heima','20210301_001','cf1:name','laoda'
put 'itcast:heima','20210301_001','cf1:age',20
put 'itcast:heima','20210301_001','cf2:phone','110'
put 'itcast:heima','20210201_002','cf1:name','laoer'
put 'itcast:heima','20210201_002','cf2:phone','120'
put 'itcast:heima','20210301_003','cf1:name','laosan'
scan 'itcast:heima'