Anna(支持任意扩展和超高性能的KV数据库系统)阅读笔记
<h1 id="前言">前言</h1>
<p>年前被同事安利了这个分布式最终一致性的存储系统 <a href="http://db.cs.berkeley.edu/jmh/papers/anna_ieee18.pdf">Anna</a> 。初略看了一眼Paper,似乎很是牛X。说是支持任意规模的扩展,并且性能不低于 <a href="https://github.com/fastio/pedis">pedis</a>。于是抽空来看看并了解下这套系统的设计特点和这种夸张的单机性能和扩展性的来源。</p>
<h1 id="主流分布式kvs的比较">主流分布式KVS的比较</h1>
<table>
<thead>
<tr>
<th>系统名词</th>
<th>扩容设计</th>
<th>内存模型</th>
<th>针对单个Key的一致性策略</th>
<th>针对多个Key一致性策略</th>
</tr>
</thead>
<tbody>
<tr>
<td>Masstree</td>
<td>多核</td>
<td>共享内存</td>
<td><a href="https://en.wikipedia.org/wiki/Linearizability"><strong>线性(Linearizable)</strong></a></td>
<td>无</td>
</tr>
<tr>
<td>Bw-tree</td>
<td>多核</td>
<td>共享内存</td>
<td><a href="https://en.wikipedia.org/wiki/Linearizability"><strong>线性(Linearizable)</strong></a></td>
<td>无</td>
</tr>
<tr>
<td>PALM</td>
<td>多核</td>
<td>共享内存</td>
<td><a href="https://en.wikipedia.org/wiki/Linearizability"><strong>线性(Linearizable)</strong></a></td>
<td>无</td>
</tr>
<tr>
<td>MICA</td>
<td>多核</td>
<td>共享内存</td>
<td><a href="https://en.wikipedia.org/wiki/Linearizability"><strong>线性(Linearizable)</strong></a></td>
<td>无</td>
</tr>
<tr>
<td>Redis</td>
<td>单核</td>
<td>N/A</td>
<td><a href="https://en.wikipedia.org/wiki/Linearizability"><strong>线性(Linearizable)</strong></a></td>
<td><a href="https://en.wikipedia.org/wiki/Serializability"><strong>串行化(Serializable)</strong></a></td>
</tr>
<tr>
<td>COPS, Bolt-on</td>
<td>分布式</td>
<td>消息队列</td>
<td><a href="https://en.wikipedia.org/wiki/Eventual_consistency"><strong>最终一致性(Eventual)</strong></a></td>
<td><a href="https://en.wikipedia.org/wiki/Causal_consistency"><strong>因果一致性(Causal)</strong></a></td>
</tr>
<tr>
<td>Bayou</td>
<td>分布式</td>
<td>消息队列</td>
<td><a href="https://en.wikipedia.org/wiki/Eventual_consistency"><strong>最终一致性(Eventual)</strong></a>, 单调读/写, <a href="http://www.dbms2.com/2010/05/01/ryw-read-your-writes-consistency/"><strong>Read Your Writes</strong></a></td>
<td><a href="https://en.wikipedia.org/wiki/Eventual_consistency"><strong>最终一致性(Eventual)</strong></a></td>
</tr>
<tr>
<td>Dynamo</td>
<td>分布式</td>
<td>消息队列</td>
<td><a href="https://en.wikipedia.org/wiki/Linearizability"><strong>线性(Linearizable)</strong></a>, <a href="https://en.wikipedia.org/wiki/Eventual_consistency"><strong>最终一致性(Eventual)</strong></a></td>
<td>无</td>
</tr>
<tr>
<td>Cassandra</td>
<td>分布式</td>
<td>消息队列</td>
<td><a href="https://en.wikipedia.org/wiki/Linearizability"><strong>线性(Linearizable)</strong></a>, <a href="https://en.wikipedia.org/wiki/Eventual_consistency"><strong>最终一致性(Eventual)</strong></a></td>
<td>无</td>
</tr>
<tr>
<td>PNUTS</td>
<td>分布式</td>
<td>消息队列</td>
<td>线性写, 单调读</td>
<td>无</td>
</tr>
<tr>
<td>CouchDB</td>
<td>分布式</td>
<td>消息队列</td>
<td><a href="https://en.wikipedia.org/wiki/Eventual_consistency"><strong>最终一致性(Eventual)</strong></a></td>
<td>无</td>
</tr>
<tr>
<td>Voldemort</td>
<td>分布式</td>
<td>消息队列</td>
<td><a href="https://en.wikipedia.org/wiki/Linearizability"><strong>线性(Linearizable)</strong></a>, <a href="https://en.wikipedia.org/wiki/Eventual_consistency"><strong>最终一致性(Eventual)</strong></a></td>
<td>无</td>
</tr>
<tr>
<td>HBase</td>
<td>分布式</td>
<td>消息队列</td>
<td><a href="https://en.wikipedia.org/wiki/Linearizability"><strong>线性(Linearizable)</strong></a></td>
<td>无</td>
</tr>
<tr>
<td>Riak</td>
<td>分布式</td>
<td>消息队列</td>
<td><a href="https://en.wikipedia.org/wiki/Eventual_consistency"><strong>最终一致性(Eventual)</strong></a></td>
<td>无</td>
</tr>
<tr>
<td>DocumentDB</td>
<td>分布式</td>
<td>消息队列</td>
<td><a href="https://en.wikipedia.org/wiki/Eventual_consistency"><strong>最终一致性(Eventual)</strong></a>, <a href="https://www.allthingsdistributed.com/2007/12/eventually_consistent.html"><strong>Session</strong></a>, <a href="http://pbs.cs.berkeley.edu/"><strong>Bounded Staleness</strong></a>, <a href="https://en.wikipedia.org/wiki/Linearizability"><strong>线性(Linearizable)</strong></a></td>
<td>无</td>
</tr>
<tr>
<td>Memcached</td>
<td>多核&分布式</td>
<td>共享内存&消息队列</td>
<td><a href="https://en.wikipedia.org/wiki/Linearizability"><strong>线性(Linearizable)</strong></a></td>
<td>无</td>
</tr>
<tr>
<td>MongoDB</td>
<td>多核&分布式</td>
<td>共享内存&消息队列</td>
<td><a href="https://en.wikipedia.org/wiki/Linearizability"><strong>线性(Linearizable)</strong></a></td>
<td>无</td>
</tr>
<tr>
<td>H-Store</td>
<td>多核&分布式</td>
<td>消息队列</td>
<td><a href="https://en.wikipedia.org/wiki/Linearizability"><strong>线性(Linearizable)</strong></a></td>
<td><a href="https://en.wikipedia.org/wiki/Serializability"><strong>串行化(Serializable)</strong></a></td>
</tr>
<tr>
<td>ScyllaDB</td>
<td>多核&分布式</td>
<td>消息队列</td>
<td><a href="https://en.wikipedia.org/wiki/Linearizability"><strong>线性(Linearizable)</strong></a>, <a href="https://en.wikipedia.org/wiki/Eventual_consistency"><strong>最终一致性(Eventual)</strong></a></td>
<td>无</td>
</tr>
<tr>
<td>Anna</td>
<td>多核&分布式</td>
<td>消息队列</td>
<td><a href="https://en.wikipedia.org/wiki/Eventual_consistency"><strong>最终一致性(Eventual)</strong></a>, <a href="https://en.wikipedia.org/wiki/Eventual_consistency"><strong>最终一致性(Eventual)</strong></a>, Item Cut, Writes Follow Reads, 单调读/写, <a href="http://www.dbms2.com/2010/05/01/ryw-read-your-writes-consistency/"><strong>Read Your Writes</strong></a>, <a href="https://en.wikipedia.org/wiki/PRAM_consistency"><strong>PRAM</strong></a></td>
<td><a href="https://jepsen.io/consistency/models/read-committed"><strong>Read Committed</strong></a>, <a href="https://jepsen.io/consistency/models/read-uncommitted"><strong>Read Uncommitted</strong></a></td>
</tr>
</tbody>
</table>
<blockquote>
<p>一致性说明:</p>