NoSQL数据库比较整理-不断更新

 

 

 

四类 NoSQL数据库存储类型:

1. Key-values 存储. 其主要思想是应用哈希表,是一种最简单和最早的应用,适用于一次写入多次读取的场景。

 

key-value分布式存储系统查询速度快、存放数据量大、支持高并发,非常适合通过主键进行查询,但不能进行复杂的条件查询。如果辅以Real- Time Search Engine(实时搜索引擎)进行复杂条件检索、全文检索,就可以替代并发性能较低的MySQL等关系型数据库,达到高并发、高性能,节省几十倍服务器数量的目的。以MemcacheDB、Tokyo Tyrant为代表的key-value分布式存储,在上万并发连接下,轻松地完成高速查询。而MySQL,在几百个并发连接下,就基本上崩溃了。

  虽然key-value分布式存储具有极高的性能,但是只能做类似于MySQL的SELECT * FROM table WHERE id = 123;简单主键查询。

  “搜索索引引擎+key-value分布式存储”能够实现高并发的复杂条件查询、全文检索与数据显示。但是,由于索引更新需要时间,目前还不能实现完全意义上的Real-Time Search(实时搜索),只能称之为Near Real-Time Search(准实时搜索)。“搜索索引引擎+key-value分布式存储”除了做全文检索外,还可以在允许的索引延迟范围内,取代MySQL进行复杂条件查询 

 

典型库Tokyo Cabinet/Tyrant, Redis, Voldemort, Oracle BDB
典型应用Content caching (Focus on scaling to huge amounts of data, designed to handle massive load), logging, etc.
数据模型collection of Key-Value pairs
有点快速查询
缺点存储的数据没有一个模式

2. Column Family Stores.

These were created to store and process very large amounts of data distributed over many machines. There are still keys but they point to multiple columns. The columns are arranged by column family.

ExamplesCassandra, HBase, Riak
Typical applicationsDistributed file systems
Data modelColumns → column families
StrengthsFast lookups, good distributed storage of data
WeaknessesVery low-level API

3. Document Databases. These were inspired by Lotus Notes and are similar to key-value stores. The model is basically versioned documents that are collections of other key-value collections. The semi-structured documents are stored in formats like JSON. Document databases are essentially the next level of Key/value, allowing nested values associated with each key.  Document databases support querying more efficiently.

ExamplesCouchDB, MongoDb
Typical applicationsWeb applications (Similar to Key-Value stores, but the DB knows what the Value is)
Data modelCollections of Key-Value collections
StrengthsTolerant of incomplete data
WeaknessesQuery performance, no standard query syntax

4. Graph Databases. Instead of tables of rows and columns and the rigid structure of SQL, a flexible graph model is used which, again, can scale across multiple machines. NoSQL databases do not provide a high-level declarative query language like SQL to avoid overtime in processing. Rather, querying these databases is data-model specific. Many of the NoSQL platforms allow for RESTful interfaces to the data, while other offer query APIs.

ExamplesNeo4J, InfoGrid, Infinite Graph
Typical applicationsSocial networking, Recommendations (Focus on modeling the structure of data – interconnectivity)
Data model“Property Graph” – Nodes
StrengthsGraph algorithms e.g. shortest path, connectedness, n degree relationships, etc.
WeaknessesHas to traverse the entire graph to achieve a definitive answer. Not easy to cluster.
Generally, the best places to use NoSQL technology is where the data model is simple; where flexibility is more important than strict control over defined data structures; where high performance is a must; strict data consistency is not required; and where it is easy to map complex values to known keys. 

参考:http://blog.monitis.com/index.php/2011/05/22/picking-the-right-nosql-database-tool/ 

 

参考及进一步阅读 

NoSQL介绍:

http://kkovacs.eu/cassandra-vs-mongodb-vs-couchdb-vs-redis 

NoSQL性能测试对比:

posted on 2011-07-01 00:19  小司  阅读(793)  评论(0编辑  收藏  举报