日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

Cassandra,Mongodb,CouchDB,Redis,Riak,HBase比

系統(tǒng) 4098 0

http://www.open-abc.com/nosql-214.html

盡管 SQL 數(shù)據(jù)庫(kù)一直是我們IT行業(yè)中最有用的工具,然而,它們這樣在行業(yè)中超過(guò)15年以上的“轉(zhuǎn)正”終于就要壽終正寢了。現(xiàn)在,雖然關(guān)系型數(shù)據(jù)庫(kù)仍然無(wú)所不在,但它越來(lái)越不能滿足我們的需要了。NoSQL成為了業(yè)界的新寵。

但是,各種 “NoSQL” 數(shù)據(jù)庫(kù)之間的差異比當(dāng)年眾多關(guān)系型數(shù)據(jù)庫(kù)之間的差異要大許多。這就加大了人們?cè)诮ㄔO(shè)自己的應(yīng)用是選擇合適的數(shù)據(jù)庫(kù)的難度。

在這篇匯總的PK中,我們對(duì) Cassandra, Mongodb, CouchDB, Redis, Riak 和 HBase 進(jìn)行了比較,以供參考:
CouchDB

* Written in: Erlang
* Main point關(guān)鍵點(diǎn): DB consistency一致性, ease of use易用
* License 許可協(xié)議: Apache
* Protocol 協(xié)議: HTTP/REST
* Bi-directional (!) replication雙向復(fù)制,
* continuous or ad-hoc,
* with conflict detection沖突檢測(cè),
* thus, master-master replication. (!) 主主復(fù)制
* MVCC – write operations do not block reads 寫(xiě)操作不會(huì)阻塞讀操作
* Previous versions of documents are available 文本式
* Crash-only (reliable) design 可靠性設(shè)計(jì)
* Needs compacting from time to time
* Views: embedded內(nèi)部嵌入 map/reduce算法
* Formatting views: lists & shows
* Server-side document validation possible
* Authentication possible
* Real-time updates via _changes (!) 實(shí)時(shí)更新
* Attachment handling
* thus, CouchApps (standalone js apps)
* jQuery library included

適用: 累計(jì) 堆積計(jì)算, 偶爾改變數(shù)據(jù), 預(yù)先定義的查詢. 非常注重版本控制的場(chǎng)合.

舉例: CRM, CMS系統(tǒng). 主-主復(fù)制是其特別亮點(diǎn),可以易于多個(gè)站點(diǎn)部署。


Redis

* Written in: C/C++
* Main point 關(guān)鍵點(diǎn): Blazing fast 超快
* License: BSD
* Protocol: Telnet-like
* Disk-backed in-memory database, 磁盤(pán)后備,內(nèi)存數(shù)據(jù)庫(kù)
* but since 2.0, it can swap to disk. 但是從2.0開(kāi)始直接交換到磁盤(pán)
* Master-slave replication 主-從復(fù)制
* Simple keys and values, 簡(jiǎn)單的key-value形式
* but complex operations like ZREVRANGEBYSCORE 但是復(fù)雜操作類似ZREVRANGEBYSCORE
* INCR & co (good for rate limiting or statistics)
* Has sets (also union/diff/inter)
* Has lists (also a queue; blocking pop)
* Has hashes (objects of multiple fields)
* Of all these databases, only Redis does transactions (!) 在這些數(shù)據(jù)庫(kù)中,只有Redis有事務(wù)機(jī)制。
* Values can be set to expire (as in a cache) 如同緩存一樣,值能被設(shè)置為超過(guò)一定時(shí)間過(guò)期失效。
* Sorted sets (high score table, good for range queries) 有排序的sets,善于range查詢。
* Pub/Sub and WATCH on data changes (!) 采取Pub/Sub 和觀察者WATCH事件觸發(fā)數(shù)據(jù)變化。

適用: 在可以控制的數(shù)據(jù)庫(kù)大小情況下(放得下整個(gè)內(nèi)存),快速改變數(shù)據(jù),快速寫(xiě)數(shù)據(jù)。

舉例: 股票價(jià)格系統(tǒng) 分析,實(shí)時(shí)數(shù)據(jù)收集,聯(lián)系等等。


MongoDB

* Written in: C++
* Main point: Retains some friendly properties of SQL. 保留類似SQL風(fēng)格.(Query, index)
* License: AGPL (Drivers: Apache)
* Protocol: Custom, binary (BSON)
* Master/slave replication 主從復(fù)制(分布式狀態(tài)集群方式)
* Queries are javascript expressions 查詢是javascript表達(dá)式
* Run arbitrary javascript functions server-side
* Better update-in-place than CouchDB 比CouchDB更好地就地更新
* Sharding built-in 內(nèi)置分片碎片
* Uses memory mapped files for data storage 使用內(nèi)存對(duì)應(yīng)文件方式實(shí)現(xiàn)數(shù)據(jù)存儲(chǔ)
* Performance over features
* After crash, it needs to repair tables 當(dāng)崩潰后,需要修復(fù)表。

適用: 需要?jiǎng)討B(tài)查詢. 愿意事先定義索引indexes, 不需要 map/reduce 功能. 你需要巨大的數(shù)據(jù)庫(kù)有良好性能,你需要CouchDB但是你數(shù)據(jù)變化改變很頻繁,需要頻繁寫(xiě)。

舉例: 適合所有MySQL 或者 PostgreSQL場(chǎng)合,它也適合


Cassandra

* Written in: Java
* Main point: 大表模型BigTable 和 Dynamo中最好的
* License: Apache
* Protocol: Custom, binary (Thrift)
* Tunable trade-offs for distribution and replication (N, R, W)
* Querying by column, range of keys 按列查詢
* BigTable-like features: columns, column families 列
* Writes are much faster than reads (!) 寫(xiě)快于讀
* Map/reduce possible with Apache Hadoop
* 部分復(fù)雜性可能由于Java自身原因(如配置configuration, seeing exceptions, etc)

適用: 當(dāng)寫(xiě)操作多于讀操作 (如日志logging).

舉例: 銀行Banking, 金融系統(tǒng),寫(xiě)必須快于都的場(chǎng)合,實(shí)時(shí)的數(shù)據(jù)分析等.
?

Riak

* Written in: Erlang & C, some Javascript
* Main point: 容錯(cuò)性Fault tolerance 失敗恢復(fù) 可靠性好
* License: Apache
* Protocol: HTTP/REST
* Tunable trade-offs for distribution and replication (N, R, W)
* Pre- and post-commit hooks,
* for validation and security.
* Built-in full-text search 內(nèi)置全文本搜索
* 在Javascript 中Map/reduce 或 Erlang 支持
* Comes in “open source” and “enterprise” editions 有兩個(gè)版本

適用: 如果你希望有類似Cassandra-like (Dynamo-like)風(fēng)格, 但是你不想處理器復(fù)雜性和膨脹性。單服務(wù)器有良好可伸縮性scalability, 可用性availability 和容錯(cuò)性 fault-tolerance, 采取是昂貴的多站點(diǎn)復(fù)制multi-site replication.

舉例: 銷售點(diǎn)數(shù)據(jù)收集,工廠控制系統(tǒng),那些不能允許幾秒當(dāng)機(jī)的場(chǎng)合。

HBase

(With the help of ghshephard)

* Written in: Java
* Main point: 十億級(jí)別的行 X 百萬(wàn)級(jí)別的列 大容量
* License: Apache
* Protocol: HTTP/REST (also Thrift)
* Modeled after BigTable 大表模型
* Map/reduce with Hadoop 內(nèi)置Map/reduce
* Query predicate push down via server side scan and get filters
* Optimizations for real time queries 能夠?qū)崟r(shí)獲得基于查詢的優(yōu)化
* A high performance Thrift gateway 高性能的Thrift型網(wǎng)關(guān)
* HTTP supports XML, Protobuf, and binary
* Cascading, hive, and pig source and sink modules
* Jruby-based (JIRB) shell
* No single point of failure 無(wú)單點(diǎn)風(fēng)險(xiǎn)
* Rolling restart for configuration changes and minor upgrades
* Random access performance is like MySQL 隨機(jī)訪問(wèn)的性能類似MySQL

適用: 如果你喜歡大表模型BigTable. 你需要隨機(jī)實(shí)時(shí)的讀寫(xiě)操作

舉例: Facebook 消息數(shù)據(jù)庫(kù)

當(dāng)然,所有這些數(shù)據(jù)庫(kù)系統(tǒng)都有比列在這里多得多的功能特性。我這里僅僅依據(jù)我個(gè)人認(rèn)識(shí)列出一些關(guān)鍵特性,并且這些項(xiàng)目的開(kāi)發(fā)也很活躍,我將盡力保持更新。

Cassandra,Mongodb,CouchDB,Redis,Riak,HBase比較-轉(zhuǎn)


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

您的支持是博主寫(xiě)作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對(duì)您有幫助就好】

您的支持是博主寫(xiě)作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長(zhǎng)會(huì)非常 感謝您的哦!!!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 望谟县| 乐业县| 太保市| 普兰县| 新巴尔虎右旗| 广昌县| 铅山县| 松溪县| 大洼县| 加查县| 桐柏县| 濉溪县| 马公市| 淮南市| 宣汉县| 扎赉特旗| 酒泉市| 浦城县| 许昌市| 周至县| 吴桥县| 宿松县| 通城县| 呈贡县| 宜君县| 平安县| 贵州省| 青海省| 岚皋县| 仁布县| 乐业县| 樟树市| 拜泉县| 亳州市| 东台市| 曲麻莱县| 卢氏县| 云林县| 大冶市| 南投市| 吉林省|