<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>出家如初，成佛有余&#187; cap theorem</title>
	<atom:link href="http://www.yeeach.com/tag/cap-theorem/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.yeeach.com</link>
	<description>专注电子商务领域，关注无线互联网，关注新媒体；Yeeach.com用于记录我技术生涯的点滴</description>
	<lastBuildDate>Sun, 25 Jul 2010 10:30:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>distributed key-value store 杂思</title>
		<link>http://www.yeeach.com/2009/09/27/distributed-key-value-store-%e6%9d%82%e6%80%9d/</link>
		<comments>http://www.yeeach.com/2009/09/27/distributed-key-value-store-%e6%9d%82%e6%80%9d/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 17:20:57 +0000</pubDate>
		<dc:creator>chuanliang</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[cap theorem]]></category>
		<category><![CDATA[高性能服务器]]></category>
		<category><![CDATA[key-value store]]></category>
		<category><![CDATA[mongodb]]></category>
		<category><![CDATA[redis]]></category>
		<category><![CDATA[tokyo cabinet]]></category>
		<category><![CDATA[架构]]></category>

		<guid isPermaLink="false">http://www.yeeach.com/2009/09/27/distributed-key-value-store-%e6%9d%82%e6%80%9d/</guid>
		<description><![CDATA[&#160;&#160;&#160; distributed key-value&#160; store是当下比较流行的话题，尤其在构建诸如搜索引擎、IM、P2P、游戏服务器、SNS等大型互联网应用以及提供云计算服务的时候，怎样保证系统在海量数据环境下的高性能、高可靠性、高扩展性、高可用性、低成本成为所有系统架构们挖苦心思考虑的重点，而怎样解决数据库服务器的性能瓶颈是最大的挑战。 &#160;&#160;&#160; 按照分布式领域的CAP理论（Consistency、Availability、Tolerance to network Partitions这三部分在任何系统架构实现时只可能同时满足其中二点，没法三者兼顾）来衡量，传统的关系数据库的ACID只满足了Consistency、Availability，因此在Partition tolerance上就很难做得好。另外传统的关系数据库处理海量数据、分布式架构时候在Performance、Scalability、Availability等方面也存在很大的局限性。 &#160;&#160;&#160; 而key-value store更加注重对海量数据存取的性能、分布式、扩展性支持上，并不需要传统关系数据库的一些特征，例如：Schema、事务、完整SQL查询支持等等，因此在分布式环境下的性能相对于传统的关系数据库有较大的提升。当然不同的key-value store根据应用需求的不同，在设计理念并不完全相同，例如以Google BigTable、Amazon Dynamo为例： &#160;&#160;&#160; BigTable is a CA system; it is strongly consistent and highly available, but can be unavailable under network partitions.&#160; BigTable has no replication at the database level, rather replication is handled underneath by GFS. &#160;&#160; Dynamo is an [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;&#160;&#160; distributed key-value&#160; store是当下比较流行的话题，尤其在构建诸如搜索引擎、IM、P2P、游戏服务器、SNS等大型互联网应用以及提供云计算服务的时候，怎样保证系统在海量数据环境下的高性能、高可靠性、高扩展性、高可用性、低成本成为所有系统架构们挖苦心思考虑的重点，而怎样解决数据库服务器的性能瓶颈是最大的挑战。</p>
<p>&#160;&#160;&#160; 按照分布式领域的<a href="http://www.julianbrowne.com/article/viewer/brewers-cap-theorem" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.julianbrowne.com/article/viewer/brewers-cap-theorem');">CAP理论</a>（Consistency、Availability、Tolerance to network Partitions这三部分在任何系统架构实现时只可能同时满足其中二点，没法三者兼顾）来衡量，传统的关系数据库的ACID只满足了Consistency、Availability，因此在Partition tolerance上就很难做得好。另外传统的关系数据库处理海量数据、分布式架构时候在Performance、Scalability、Availability等方面也存在很大的局限性。</p>
<p>&#160;&#160;&#160; 而key-value store更加注重对海量数据存取的性能、分布式、扩展性支持上，并不需要传统关系数据库的一些特征，例如：Schema、事务、完整SQL查询支持等等，因此在分布式环境下的性能相对于传统的关系数据库有较大的提升。当然不同的key-value store根据应用需求的不同，在设计理念并不完全相同，例如以<a href="http://labs.google.com/papers/bigtable-osdi06.pdf" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://labs.google.com/papers/bigtable-osdi06.pdf');">Google BigTable</a>、<a href="http://s3.amazonaws.com/AllThingsDistributed/sosp/amazon-dynamo-sosp2007.pdf" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://s3.amazonaws.com/AllThingsDistributed/sosp/amazon-dynamo-sosp2007.pdf');">Amazon Dynamo</a>为例：</p>
<p><em>&#160;&#160;&#160; BigTable is a CA system; it is strongly consistent and highly available, but can be unavailable under network partitions.&#160; BigTable has no replication at the database level, rather replication is handled underneath by GFS.</em></p>
<p><em>&#160;&#160; Dynamo is an AP system; it is highly available, even under network partitions, but eventually consistent.&#160; Data is replicated within a single cluster, so even under partitions most data is available, however one node’s latest version might not match that of another, so every reader is only guaranteed to see every write eventually.</em><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </em></p>
<p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <a href="http://www.yeeach.com/wp-content/uploads/2009/09/cap.png" ><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="cap理论,cap theorem,base" border="0" alt="cap理论,cap theorem,base" src="http://www.yeeach.com/wp-content/uploads/2009/09/cap-thumb.png" width="644" height="236" /></a>&#160;&#160; </em></p>
<p>&#160;&#160;&#160; 其实使用key-value store的历史已经很久了，以前在做电信计费时候的Radius服务器就采用Berkeley DB这样经典的key-value store作为用户数据库，只不过早期使用这样的key-value store关注的重点主要在性能上，对于分布式、海量数据的处理并非考虑的重点。</p>
<h3><strong>1、key-value store与RDBMS的区别</strong></h3>
<p>摘自:<a href="http://www.readwriteweb.com/enterprise/2009/02/is-the-relational-database-doomed.php" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.readwriteweb.com/enterprise/2009/02/is-the-relational-database-doomed.php');">Is the Relational Database Doomed?</a></p>
<p><a href="http://www.yeeach.com/wp-content/uploads/2009/09/relational-database-feb09c.png" ><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="key-value store,rdbms,distributed hash table" border="0" alt="key-value store,rdbms,distributed hash table" src="http://www.yeeach.com/wp-content/uploads/2009/09/relational-database-feb09c-thumb.png" width="644" height="367" /></a> </p>
<p><a href="http://www.yeeach.com/wp-content/uploads/2009/09/relational-database-feb09e.png" ><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="key-value store,rdbms,distributed hash table" border="0" alt="key-value store,rdbms,distributed hash table" src="http://www.yeeach.com/wp-content/uploads/2009/09/relational-database-feb09e-thumb.png" width="644" height="275" /></a> </p>
<p><a href="http://www.yeeach.com/wp-content/uploads/2009/09/relational-database-feb09f.png" ><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="key-value store,rdbms,distributed hash table" border="0" alt="key-value store,rdbms,distributed hash table" src="http://www.yeeach.com/wp-content/uploads/2009/09/relational-database-feb09f-thumb.png" width="644" height="234" /></a> </p>
<p>&#160;</p>
<h3><strong>2、一些常用的key-value的开源项目</strong></h3>
<p>这些项目的设计思路大多是参考<a href="http://labs.google.com/papers/bigtable-osdi06.pdf" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://labs.google.com/papers/bigtable-osdi06.pdf');">Google BigTable</a>、<a href="http://s3.amazonaws.com/AllThingsDistributed/sosp/amazon-dynamo-sosp2007.pdf" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://s3.amazonaws.com/AllThingsDistributed/sosp/amazon-dynamo-sosp2007.pdf');">Amazon Dynamo</a></p>
<p>&#160;&#160;&#160; <a href="http://www.yeeach.com/wp-content/uploads/2009/09/richardjones-antirdbmsalistofdistributedkeyvaluestores.png" ><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Richard Jones _ Anti-RDBMS  A list of distributed key-value stores" border="0" alt="Richard Jones _ Anti-RDBMS  A list of distributed key-value stores" src="http://www.yeeach.com/wp-content/uploads/2009/09/richardjones-antirdbmsalistofdistributedkeyvaluestores-thumb.png" width="516" height="484" /></a> </p>
<p>除了以上罗列的产品外，还有如下一些产品</p>
<p><a href="http://1978th.net/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://1978th.net/');">Tokyo cabinet</a></p>
<p><a href="http://code.google.com/p/redis/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://code.google.com/p/redis/');">Redis</a></p>
<p><a href="http://www.mongodb.org" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.mongodb.org');">MongoDB</a></p>
<p><u><a href="http://www.oracle.com/technology/products/berkeley-db/index.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.oracle.com/technology/products/berkeley-db/index.html');">Oracle Berkeley DB</a></u></p>
<p><u><a href="http://opensource.plurk.com/LightCloud/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://opensource.plurk.com/LightCloud/');">LightCloud</a></u></p>
<p><u><a href="http://luxio.sourceforge.net/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://luxio.sourceforge.net/');">Lux IO</a></u></p>
<p><a href="https://launchpad.net/drizzle" onclick="javascript:pageTracker._trackPageview('/outbound/article/https://launchpad.net/drizzle');">Drizzle</a></p>
<h5><u><a href="http://labs.gree.jp/Top/OpenSource/Flare-en.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://labs.gree.jp/Top/OpenSource/Flare-en.html');">Flare</a></u></h5>
<p>其中<a href="http://1978th.net/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://1978th.net/');">Tokyo cabinet</a>、<a href="http://code.google.com/p/redis/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://code.google.com/p/redis/');">Redis</a>、<a href="http://www.mongodb.org" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.mongodb.org');">MongoDB</a>各有特色，可以作为项目使用key-value store时候的重点评估对象。</p>
<p>&#160;</p>
<h3><strong>3、与工作相关的一些可以使用key-value store的应用场合</strong></h3>
<p>&#160;&#160;&#160; Cache：Memcachedb、Tokyo Tyrant</p>
<p>&#160;&#160;&#160; 网络通信：做IM、P2P时候做单点登录服务器、状态服务器；消息队列服务器（Tokyo Tyrant）</p>
<p>&#160;&#160;&#160; 交易系统：计费系统cdr及预处理后的账单数据；交易系统风控系统（内存数据库,redis）</p>
<p>&#160;&#160;&#160; 日志：服务器访问日志，用于web analytics使用；呼叫中心的呼叫数据；</p>
<p>&#160;&#160;&#160; 爬虫及搜索引擎：爬取页面日志；爬取任务；索引库</p>
<p>&#160;&#160;&#160; SNS社区及CMS站点：可以大规模应用Tokyo Cabinet+Tokyo Tyrant，结合Solr/Lucene或这样的Sphinx搜索引擎搞定查询问题</p>
</p>
</p>
<p>&#160;&#160;&#160; 云存储：</p>
<h3><strong>4、参考资料</strong></h3>
<p>&#160;&#160;&#160; <a title="http://www.julianbrowne.com/article/viewer/brewers-cap-theorem" href="http://www.julianbrowne.com/article/viewer/brewers-cap-theorem" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.julianbrowne.com/article/viewer/brewers-cap-theorem');">Brewers CAP Theorem</a></p>
<p>&#160;&#160;&#160; <a href="http://www.cs.berkeley.edu/%7Ebrewer/cs262b-2004/PODC-keynote.pdf" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.cs.berkeley.edu/%7Ebrewer/cs262b-2004/PODC-keynote.pdf');">Towards Robust Distributed Systems</a></p>
<p>&#160;&#160;&#160; <a title="http://devblog.streamy.com/tag/availability/" href="http://devblog.streamy.com/tag/availability/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://devblog.streamy.com/tag/availability/');">CAP Theorem</a></p>
<p>&#160;&#160;&#160; <a href="http://blog.dotkam.com/2009/08/30/key-value-store-list/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://blog.dotkam.com/2009/08/30/key-value-store-list/');">Key Value Store List</a></p>
<p>&#160;&#160;&#160; <a href="http://www.metabrew.com/article/anti-rdbms-a-list-of-distributed-key-value-stores/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.metabrew.com/article/anti-rdbms-a-list-of-distributed-key-value-stores/');">Anti-RDBMS: A list of distributed key-value stores</a></p>
<p>&#160;&#160;&#160; <a href="http://www.jurriaanpersyn.com/archives/2009/02/12/database-sharding-at-netlog-with-mysql-and-php/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.jurriaanpersyn.com/archives/2009/02/12/database-sharding-at-netlog-with-mysql-and-php/');">Database Sharding at Netlog, with MySQL and PHP</a></p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:2a7ccd96-d498-432e-a457-6a838309e71f" class="wlWriterEditableSmartContent">Technorati 标签: <a href="http://technorati.com/tags/cap+theorem" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://technorati.com/tags/cap+theorem');" rel="tag">cap theorem</a>,<a href="http://technorati.com/tags/key-value+store" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://technorati.com/tags/key-value+store');" rel="tag">key-value store</a>,<a href="http://technorati.com/tags/%e6%9e%b6%e6%9e%84" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://technorati.com/tags/%e6%9e%b6%e6%9e%84');" rel="tag">架构</a>,<a href="http://technorati.com/tags/%e9%ab%98%e6%80%a7%e8%83%bd%e6%9c%8d%e5%8a%a1%e5%99%a8" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://technorati.com/tags/%e9%ab%98%e6%80%a7%e8%83%bd%e6%9c%8d%e5%8a%a1%e5%99%a8');" rel="tag">高性能服务器</a>,<a href="http://technorati.com/tags/tokyo+cabinet" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://technorati.com/tags/tokyo+cabinet');" rel="tag">tokyo cabinet</a>,<a href="http://technorati.com/tags/redis" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://technorati.com/tags/redis');" rel="tag">redis</a>,<a href="http://technorati.com/tags/mongodb" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://technorati.com/tags/mongodb');" rel="tag">mongodb</a></div>
	<p></p>
	<hr noshade style="margin:0;height:1px" />
	<p>&copy; chuanliang for <a href="http://www.yeeach.com" >出家如初，成佛有余</a>, 2009. |
	  <a href="http://www.yeeach.com/2009/09/27/distributed-key-value-store-%e6%9d%82%e6%80%9d/" >Permalink</a> |
	  <a href="http://www.yeeach.com/2009/09/27/distributed-key-value-store-%e6%9d%82%e6%80%9d/#comments" >2 comments</a></p>
	<p>Add to <a href="http://del.icio.us/post?url=http://www.yeeach.com/2009/09/27/distributed-key-value-store-%e6%9d%82%e6%80%9d/&amp;title=distributed key-value store 杂思" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://del.icio.us/post?url=http://www.yeeach.com/2009/09/27/distributed-key-value-store-%e6%9d%82%e6%80%9d/&amp;title=distributed key-value store 杂思');">del.icio.us</a></p>
	<p>Search blogs linking this post with <a href="http://www.technorati.com/search/http://www.yeeach.com/2009/09/27/distributed-key-value-store-%e6%9d%82%e6%80%9d/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.technorati.com/search/http://www.yeeach.com/2009/09/27/distributed-key-value-store-%e6%9d%82%e6%80%9d/');" title="Search on Technorati">Technorati</a></p>
	<p>Want more on these topics ? Browse the archive of posts filed under <a href="http://www.yeeach.com/category/%e6%8a%80%e6%9c%af-%e8%bd%af%e4%bb%b6/"  title="查看 技术相关 的全部文章" rel="category tag">技术相关</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.yeeach.com/2009/09/27/distributed-key-value-store-%e6%9d%82%e6%80%9d/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
