[论文解读] FoundationDB Record Layer: A Multi-Tenant Structured Datastore
FoundationDB 记录层是一个开源的、无状态的、多租户的结构化数据存储系统,基于 FoundationDB 构建,提供类似关系型的语义——包括模式管理、丰富的索引(包括版本化和跨类型索引)以及声明式查询——同时继承了 ACID 事务和可扩展性。它通过将每个租户的数据和索引隔离到逻辑数据库中,实现了大规模多租户支持,使 CloudKit 能够以高性能和低维护开销管理数十亿个用户数据库。
The FoundationDB Record Layer is an open source library that provides a record-oriented data store with semantics similar to a relational database implemented on top of FoundationDB, an ordered, transactional key-value store. The Record Layer provides a lightweight, highly extensible way to store structured data. It offers schema management and a rich set of query and indexing facilities, some of which are not usually found in traditional relational databases, such as nested record types, indexes on commit versions, and indexes that span multiple record types. The Record Layer is stateless and built for massive multi-tenancy, encapsulating and isolating all of a tenant's state, including indexes, into a separate logical database. We demonstrate how the Record Layer is used by CloudKit, Apple's cloud backend service, to provide powerful abstractions to applications serving hundreds of millions of users. CloudKit uses the Record Layer to host billions of independent databases, many with a common schema. Features provided by the Record Layer enable CloudKit to provide richer APIs and stronger semantics with reduced maintenance overhead and improved scalability.
研究动机与目标
- 解决为具有多租户和强一致性要求的状态服务构建可扩展、高可用且一致的后端所面临的挑战。
- 在 FoundationDB 之上提供一个轻量级、可扩展且无状态的层,支持结构化数据、模式演进以及复杂查询能力。
- 通过将每个租户的数据和索引封装到逻辑数据库中,实现在不牺牲事务完整性的情况下,实现高效、隔离且可扩展的多租户支持。
- 通过提供嵌套记录、版本化索引和物化聚合等丰富的数据库抽象,降低应用开发复杂度和维护开销。
- 证明分层的、可扩展的数据库架构能够支持类似 CloudKit 这类工业规模的生产工作负载。
提出的方法
- 记录层使用 Protocol Buffer 消息构建基于记录的数据模型,用于表示结构化、类型化和嵌套的数据记录。
- 提供模式管理和演进工具,以支持应用数据模型随时间的变化。
- 支持多种索引类型,包括二级索引、基于提交时间戳的版本化索引以及跨类型索引,利用 FoundationDB 的原子写操作实现无冲突的并发更新。
- 该层为无状态设计,可通过增加更多实例实现计算的水平扩展,而无需状态协调。
- 采用流式查询执行模型,查询规划器利用索引高效执行声明式查询。
- 提供广泛的扩展点,支持自定义索引类型、序列化(如加密、压缩)以及查询算子,实现深度定制。
实验结果
研究问题
- RQ1如何在大规模场景下,使分层的、无状态的数据库系统在支持海量多租户的同时,提供强 ACID 语义和丰富的查询能力?
- RQ2哪些架构模式能够实现在分布式键值存储中高效、无冲突且并发的索引维护?
- RQ3系统如何在共享基础设施上支持数十亿个隔离的逻辑数据库,同时保持高性能和低运维开销?
- RQ4哪些机制能够在不损害一致性或性能的前提下,实现数据库层的可扩展性?
- RQ5基于低层级事务性键值存储构建的高层数据抽象,是否能在真实生产系统中实现或超越传统关系型数据库的功能?
主要发现
- FoundationDB 记录层在生产环境中成功支持了数十亿个隔离的多租户数据库,被 Apple 的 CloudKit 用于服务数亿名用户。
- 该层支持诸如事务性全文索引和高并发区域等强大功能,显著提升了应用开发效率和系统性能。
- 通过使用原子写操作更新索引,系统在高负载下仍能实现无冲突的并发索引维护。
- 无状态设计支持计算的无缝水平扩展,实现计算与数据分布的解耦,简化了负载均衡。
- 可扩展性模型允许客户端插入自定义索引类型和序列化逻辑,支持加密存储和专用聚合等用例。
- 该系统证明,基于分布式键值存储的分层架构能够提供类似关系型数据库的能力,具备强一致性与高可扩展性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。