Replicated data types (RDTs), such as Conflict-free Replicated Data Types (CRDTs), provide an abstraction for reasoning about replication and consistency in distributed systems. To make them as useful as ordinary, local data structures, RDTs need to be both modular and composable, so that programmers can create new app-specific RDTs by composing existing ones. However, no existing RDT libraries combine these properties; either they use monolithic architectures that rule out new RDTs or they do not support composition techniques. In this work, we introduce the Collab (collaborative data structure), a novel abstraction for modular and composable RDTs. We also describe the collabs library, an open-source TypeScript library that we built around this abstraction. Our library supports arbitrary programmer-added RDTs and includes composition techniques that make them easier to implement. This allows programmers to work at a higher level of abstraction: custom RDTs for arbitrary concepts in their application, instead of just a fixed menu of generic RDTs. It also allows programmers to extend the library with new RDT algorithms as they are published, instead of waiting for the library to implement them. Our library includes a collection of built-in op-based CRDT implementations, including several that were not previously implemented. To demonstrate the library, we built numerous apps on top of it, including decentralized collaborative apps that can be deployed from a static web page. Benchmarks show that its CRDTs have performance comparable to state-of-the-art CRDT libraries for web apps, and that unlike existing libraries, it can support 100 simultaneous users with low latency in a geo-distributed collaborative app.
翻译:复制数据类型( RDT), 如无冲突复制数据类型( CRDTs ), 为分布式系统复制和一致性的推理提供了抽象的推理。 为了使其与普通的、本地的数据结构一样有用, RDTs 需要同时使用模块和可配置, 这样程序设计员可以通过将现有数据组合起来来创建新的应用程序特定 RDT 。 但是, 现有的 RDT 图书馆都没有将这些属性结合起来; 它们要么使用排除新的 RDT 的单一结构, 要么不支持配置技术。 在这项工作中, 我们为模块化和可兼容的 RDTs 引入了Collab( 校对数据结构), 为模块和可兼容的 RDTs 提供了全新的抽象结构。 我们的 Rellabbbs 库( Orcreports) 也可以使用新版本的 RDDT 数据库( RDT), 包括以前安装的 RDDT 数据库( RDD), 包括以前安装的 RDDD 数据库, 可以使用新的 RDDDDD 数据库, 。