这是笔者存在印象笔记里的笔记,比较零散,没整理,按照书中的顺序,就当头脑风暴知识点吧。
后面的待续
《七周七数据库》英文pdf下载地址:http://ishare.iask.sina.com.cn/f/33653299.html
PostgreSQL(关系型)
因为KV存储库对资源的要求非常少,所有这种数据库类型在一些场景中有令人难以置信的高性能,但是当你有复杂的查询和聚合需求时,它一般不会有帮助。
Riak(键-值型)
HBase(列型)
MongoDB(文档型)
CouchDB(文档型)
Neo4j 图数据库
Reddis(键-值型)
特殊数据库: Solr,Elasticsearch,Doozer
因为KV存储库对资源的要求非常少,所有这种数据库类型在一些场景中有令人难以置信的高性能,但是当你有复杂的查询和聚合需求时,它一般不会有帮助。
Riak:
支持HTTP和REST等WEB方式;
严格实现亚马逊Dynamo原理;
第一个通过mapreduce支持高级查询的数据库
Redis:
提供复杂的数据类型,如有序集合和哈希,基本消息模式,如阻塞队列
写入磁盘钱先写入内存缓存
出现硬件故障的情况下,增加了数据丢失的风险
适合用于缓存非关键数据或作为消息代理
列型数据库:HBase, Cassandra, Hypertable.
在面向列的数据库中,添加列是相当简易的,而且是逐行完成的,在结构方面,列型数据库大约介于关系型数据库和键值存储库之间。
HBase:
这个面向列的数据库与关系模型最为相似,建立在Hadoop(一个mapreduce引擎)之上。
文档型数据库,面向文档的数据库存储的就是文档。
MongoDB
设计目标是支持巨大的数据
CouchDB
设计目标是各种部署场景,从数据中心到桌面,一直到只能手机。
用Erlang编写,具有独特的坚固性,这一点在大部分其他数据库中是缺乏的。
图数据库
Neo4j
(图数据库)好处在于能够快速在节点和关系之间移动,找到相关数据。
经常应用在社交网络中,因灵活性而受到关注。
PostgreSQL
Postgres提供后台服务进程(Backend),完成所有数据处理工作,默认监听5432端口,可以用psql这个命令行工具连接。
关系数据库的关系是因为它的数学基础,不是表通过外键彼此“关联”,这样的限制是否存在并不是关键。
关系查询源于元组关系演算的数学分支,,可以转换为
关系代数。
可以在表名后面直接加别名,表名和别名之间的as是可选的
如venues v 或者 venues AS v
内连接, inner join
外连接, outer join, 不论另一张表中是否存在匹配的列值,第一张表的结果总是必须返回。
鱼尾纹实体关系图
INNER JOIN中的INNER并不是必须的,可以省略
索引是一种特殊的数据结构
PostgreSQL自动在主键上创建索引,以主键的列值为索引的键,索引的值指向磁盘上的一行。
对于操作符为小于、大于、等于这样的匹配查询,希望索引比简单的哈希更灵活,如B树索引。