Geo-replicated databases often operate under the principle of eventual consistency to offer high-availability with low latency on a simple key/value store abstraction. Recently, some have adopted commutative data types to provide seamless reconciliation for special purpose data types, such as counters. Despite this, the inability to enforce numeric invariants across all replicas still remains a key shortcoming of relying on the limited guarantees of eventual consistency storage. We present a new replicated data type, called bounded counter, which adds support for numeric invariants to eventually consistent geo-replicated databases. We describe how this can be implemented on top of existing cloud stores without modifying them, using Riak as an example. Our approach adapts ideas from escrow transactions to devise a solution that is decentralized, fault-tolerant and fast. Our evaluation shows much lower latency and better scalability than the traditional approach of using strong consistency to enforce numeric invariants, thus alleviating the tension between consistency and availability.
翻译:地理复制的数据库往往在最终一致性原则下运作,在简单的钥匙/价值存储抽象数据上提供高可用性和低延迟性的数据。最近,一些国家采用了通量数据类型,以便为特殊目的数据类型(如柜台)提供无缝的对账。尽管如此,无法在所有复制中执行数字变异性,仍然是依赖最终一致性储存有限保证的关键缺陷。我们提出了一个新的复制数据类型,称为约束式对称,这增加了数字变异性对最终一致的地理复制数据库的支持。我们用Riak为例,说明如何在现有云储存之上执行这些数据类型,而不修改这些数据类型。我们的方法是调整代管交易的想法,以设计一种分散、容错和快速的解决办法。我们的评估显示,与使用强烈一致性执行数字变异性的传统方法相比,延缓一致性和伸缩性要低得多,从而缓解一致性与可用性之间的紧张关系。