Collabs: Composable Collaborative Data Structures

12/05/2022
by   Matthew Weidner, et al.
0

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.

READ FULL TEXT

Please sign up or login with your details

Forgot password? Click here to reset