A collaboration framework is a distributed system that serves as the data layer for a collaborative app. Conflict-free Replicated Data Types (CRDTs) are a promising theoretical technique for implementing collaboration frameworks. However, existing frameworks are inflexible: they are often one-off implementations of research papers or only permit a restricted set of CRDT semantics, and they do not allow app-specific optimizations. Until now, there was no general framework that lets programmers mix, match, and modify CRDTs. We solve this with Collabs, a CRDT-based collaboration framework that lets programmers implement their own CRDTs, either from-scratch or by composing existing building blocks. Collabs prioritizes both semantic flexibility and performance flexibility: it allows arbitrary app-specific CRDT behaviors and optimizations, while still providing strong eventual consistency. We demonstrate Collabs's capabilities and programming model with example apps and CRDT implementations. We then show that a collaborative rich-text editor using Collabs's built-in CRDTs can scale to over 100 simultaneous users, unlike existing CRDT frameworks and Google Docs. Collabs also has lower end-to-end latency and server CPU usage than a popular Operational Transformation framework, with acceptable CRDT metadata overhead.
翻译:协作框架是一种分布式系统,为协作应用提供数据层支持。无冲突复制数据类型(CRDTs)是实现协作框架的一种颇具前景的理论技术。然而,现有框架缺乏灵活性:它们往往是研究论文的一次性实现,仅允许有限范围的CRDT语义,且不支持应用特定的优化。至今尚无通用框架能让程序员混合、匹配及修改CRDTs。我们通过Collabs解决了这一问题,这是一个基于CRDT的协作框架,允许程序员实现自定义CRDTs,无论是从头构建还是通过组合现有基础模块。Collabs兼顾语义灵活性与性能灵活性:它支持任意应用特定的CRDT行为与优化,同时保证强最终一致性。我们通过示例应用和CRDT实现展示了Collabs的功能与编程模型。随后,我们证明使用Collabs内置CRDTs的协作式富文本编辑器可扩展至超过100名并发用户,这一点优于现有CRDT框架及谷歌文档。与流行的操作变换框架相比,Collabs还具有更低的端到端延迟和服务器CPU使用率,仅需可接受的CRDT元数据开销。