Graph Databases—Chapter 2 The NOSQL Phenomenon阅读笔记

来源:互联网 发布:php ffmpeg 微信语音 编辑:程序博客网 时间:2024/06/07 06:30

本章内容着重对了NOSQL和RDBMS(关系型数据库管理系统)的不同,以及其各自背后设计时考虑的因素。然后接下来,着重讲述了NOSQL的4种分类方法。下面我们将对重要知识点进行汇总。

1、We define data complexity in terms of these three forces: data size, connectedness and semi-structure.

      数据复杂性通常可以通过如下三个方面来衡量:数据大小,数据紧密程度以及半结构化。这句话,说白了就是数据本身的大小,数据和数据之间是否有联系并且联系是否密切,数据是否是结构的或者半结构的或者无结构的,构成了数据复杂性的三个方面。

2、Recent years have seen a meteoric rise in popularity of a family of data storage technologies known as NOSQL (a cheeky acronym for Not Only SQL, or more confrontationally, No to SQL).  

      最近几年,NOSQL数据存储技术很为流行,一般别名是"Not Only SQL"(不单单是SQL),或者"No to SQL"(不是SQL)。从两个别名可以推断出,NOSQL不同于SQL,SQL是关系型数据库中典型的语言,NOSQL是随着技术或者日常需求逐渐发展而来的一种存储技术。

3、NOSQL兴起的3个重要因素

     1)Volume: the size of the stored data

     2)Velocity: the rate at which data changes over time

     3)Variety: the degree to which data is regularly or irregularly structured, dense or sparse, and importantly connected or disconnected.

     第一个因素是:存储的数据量大小,众所周知,目前大数据是很火的,也反映了目前数据量很大,传统的关系型数据库在性能上很难保证的很好。第二个因素是:变化的速度,以前的数据一般是静态的,所以关系型数据库表现的很好,但是随着这几年互联网行业的兴起,数据本身变化速度极快。第三个因素是:数据的种类,现在的数据多种多样,有一些是有结构的,有一些是无结构的,有一些是互有联系的。上述三点导致NOSQL的兴起。

4、In the relational database world, we’re all familiar with ACID transactions:

• Atomic: All operations in a transaction succeed or every operation is rolled back.
• Consistent: On transaction completion, the database is structurally sound.
• Isolated: Transactions do not contend with one another, contentious access to state is moderated by the database                  so that transactions appear to run sequentially.
• Durable: The results of applying a transaction are permanent, even in the presence of failures.

    关系型数据库设计考虑的4个重要因素。Atomic是“原子性”,要不然操作成功,要不然操作进行全部回滚。Consistent是“一致性”,数据库事务完成后,数据库结构仍然和以前是一样的,结构不会变化。Isolated是“隔离性”,事务和事务之间是隔离的,不存在竞争关系。Durable是“持久性”,一旦事务成功后,结果就是永久性的。

5、Instead of using ACID, the term BASE has arisen as a popular way of describing the properties of a more optimistic storage strategy.

• Basic Availability: The store appears to work most of the time.
• Soft-state: Stores don’t have to be write-consistent, nor do different replicas have to be mutually consistent all the time.
• Eventual consistency: Stores exhibit consistency at some later point (e.g. lazily at read time).

    BASE不同于ACID设计策略,是目前NOSQL设计时遵循的一些原则。其中,Basic Availability是“基本可行行”,系统大部分时间时可以运行的,这条说明存储系统允许错误发生或者硬件出现故障等。Soft-state是“软约束”,存储系统不必保存写一致性,也不必不同的备份之间是互相一致的。Eventual consistency是“最终一致性”,存储系统在后来的某点上,呈现一致性。

6、NOSQL可以分为四类:key-value, document, graph db以及bigtable,如下图所示,

                                     

7、Document存储系统

文档存储系统是以文档为基本单位,一般文档都会有一个ID,同时会从文档中提取出一些特征来代表文档,MongoDB就是一种文档存储系统。如下图所示:

                   

8、Key-Value存储系统

     They act like (large, distributed) hashmap data structures where (usually) opaque values are stored and retrieved by key.

     Key-Value存储系统类似于哈希map一样。通过key去查找value的值,key相当于索引。

     一个典型的分布式Key-Value系统如下:

            

9、BigTable存储系统

  BigTable存储系统类似于矩阵,由行和列组成,每一个单元存放数据。一般而言,BigTable由如下4种成分组成:

         

10、Key-Value、Document以及BigTable存储系统很难解决互有联系的数据。

==================================小结============================================

第二章着重讲述了NOSQL的设计原则以及分类,同时需要知道Key-Value、Document以及BigTable三个存储系统都很难解决互有联系的数据。本章是为了引出Graph DB做铺垫。

0 0
原创粉丝点击