
Industry 3: Data Platforms SIGMOD ’19, June 30–July 5, 2019, Amsterdam, Netherlands FoundationDB Record Layer: A Multi-Tenant Structured Datastore Christos Chrysafis, Ben Collins, Scott Dugas, Jay Dunkelberger, Moussa Ehsan, Scott Gray, Alec Grieser, Ori Herrnstadt, Kfir Lev-Ari, Tao Lin, Mike McMahon, Nicholas Schiefer, Alexander Shraer Apple, Inc. ABSTRACT 1 INTRODUCTION The FoundationDB Record Layer is an open source library Many applications require a scalable and highly available that provides a record-oriented data store with semantics backend that provides durable storage. Developing and op- similar to a relational database implemented on top of Foun- erating such backends presents many challenges. First, the dationDB, an ordered, transactional key-value store. The high volume of data collected by modern applications, cou- Record Layer provides a lightweight, highly extensible way pled with the large number of users and high access rates, to store structured data. It offers schema management and a requires smart partitioning and placement solutions for stor- rich set of query and indexing facilities, some of which are ing data to achieve horizontal scalability. Modern storage not usually found in traditional relational databases, such systems must scale elastically in response to increases in as nested record types, indexes on commit versions, and in- user demand for both storage capacity and computation. Sec- dexes that span multiple record types. The Record Layer is ond, as systems become larger, formerly “rare” events such stateless and built for massive multi-tenancy, encapsulating as network, disk, and machine failures become everyday and isolating all of a tenant’s state, including indexes, into a occurrences. A core challenge of distributed systems is main- separate logical database. We demonstrate how the Record taining system availability and durability in the face of these Layer is used by CloudKit, Apple’s cloud backend service, to problems. Third, many techniques for addressing scalabil- provide powerful abstractions to applications serving hun- ity and availability challenges, such as eventual consistency, dreds of millions of users. CloudKit uses the Record Layer create immense challenges for application developers. Im- to host billions of independent databases, many with a com- plementing transactions in a distributed setting remains one mon schema. Features provided by the Record Layer enable of the most challenging problems in distributed systems. CloudKit to provide richer APIs and stronger semantics with Fourth, as stateful services grow, they must support the reduced maintenance overhead and improved scalability. needs of many diverse users and applications. This multi- tenancy brings many challenges, including isolation, resource ACM Reference Format: sharing, and elasticity in the face of growing load. Many data- Christos Chrysafis, Ben Collins, Scott Dugas, Jay Dunkelberger, base systems intermingle data from different tenants at both Moussa Ehsan, Scott Gray, Alec Grieser, Ori Herrnstadt, Kfir Lev- the compute and storage levels. Retrofitting resource iso- Ari, Tao Lin, Mike McMahon, Nicholas Schiefer, and Alexander Shraer. lation to such systems is challenging. Stateful services are 2019. FoundationDB Record Layer: A Multi-Tenant Structured Data- store. In 2019 International Conference on Management of Data (SIG- especially difficult to scale elastically because state cannot MOD ’19), June 30-July 5, 2019, Amsterdam, Netherlands. ACM, New be partitioned arbitrarily. For example, data and indexes can- York, NY, USA, 16 pages. https://doi.org/10.1145/3299869.3314039 not be stored on entirely separate storage clusters without sacrificing transactional updates, performance, or both. These problems must be addressed by any company of- Permission to make digital or hard copies of all or part of this work for fering stateful services. Yet despite decades of academic and personal or classroom use is granted without fee provided that copies industrial research, they are notoriously difficult to solve are not made or distributed for profit or commercial advantage and that correctly and require a high level of expertise and experi- copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must ence. Big companies use in-house solutions, developed and be honored. Abstracting with credit is permitted. To copy otherwise, or evolved over many years by large teams of experts. Smaller republish, to post on servers or to redistribute to lists, requires prior specific companies often have little choice but to pay larger cloud permission and/or a fee. Request permissions from [email protected]. providers or sacrifice durability. SIGMOD ’19, June 30-July 5, 2019, Amsterdam, Netherlands FoundationDB [10] democratizes industrial-grade highly- © 2019 Copyright held by the owner/author(s). Publication rights licensed available and consistent storage, making it freely available to to ACM. ACM ISBN 978-1-4503-5643-5/19/06. anyone as an open source solution [11] and is currently used https://doi.org/10.1145/3299869.3314039 in production at companies such as Apple, Snowflake, and 1787 Industry 3: Data Platforms SIGMOD ’19, June 30–July 5, 2019, Amsterdam, Netherlands Wavefront. While the semantics, performance, and reliability data to another cluster as everything needed to interpret and of FoundationDB make it extremely useful, FoundationDB’s operate each record store is found in its key range. data model, an ordered mapping from binary keys to binary The Record Layer is used by multiple systems at Apple. values, is often insufficient for applications. Many of them We demonstrate the power of the Record Layer at scale by de- need structured data storage, indexing capabilities, a query scribing how CloudKit, Apple’s cloud backend service, uses language, and more. Without these, application developers it to provide strongly-consistent data storage for a large and are forced to reimplement common functionality, slowing diverse set of applications [43]. Using the Record Layer’s ab- development and introducing bugs. stractions, CloudKit offers multi-tenancy at the extreme by To address these challenges, we present the FoundationDB maintaining independent record stores for each user of each Record Layer: an open source record-oriented data store built application. As a result, we use the Record Layer on Foun- on top of FoundationDB with semantics similar to a relational dationDB to host billions of independent databases sharing database [19, 20]. The Record Layer provides schema manage- thousands of schemata. In the future, we envision that the ment, a rich set of query and indexing facilities, and a variety Record Layer will be combined with other storage models, of features that leverage FoundationDB’s advanced capa- such as queues and graphs, leveraging FoundationDB as a bilities. It inherits FoundationDB’s strong ACID semantics, general purpose storage engine to provide transactional con- reliability, and performance in a distributed setting. These sistency across all these data models. In summary, this work lightweight abstractions allow for multi-tenancy at an ex- makes the following contributions: tremely large scale: the Record Layer allows creating isolated • An open source layer on top of FoundationDB with se- logical databases for each tenant—at Apple, it is used to man- mantics akin to those of a relational database. age billions of such databases—all while providing familiar • The record store abstraction and a suite of techniques features such as transactional index maintenance. to manipulate it, enabling billions of logical tenants to The Record Layer represents structured values as Protocol operate independent databases in a FoundationDB cluster. Buffer [4] messages called records that include typed fields • An extensible architecture allowing clients to customize and even nested records. Since an application’s schema in- core features including schema management and indexing. evitably changes over time, the Record Layer includes tools • A lightweight design that provides rich features on top of for schema management and evolution. It also includes facili- the underlying key-value store. ties for planning and efficiently executing declarative queries using a variety of index types. The Record Layer leverages ad- 2 BACKGROUND ON FOUNDATIONDB vanced features of FoundationDB; for example, many aggre- FoundationDB is a distributed, ordered key-value store that gate indexes are maintained using FoundationDB’s atomic runs on clusters of commodity servers and provides ACID mutations, allowing concurrent, conflict-free updates. Be- transactions over arbitrary sets of keys using optimistic con- yond its rich feature set, the Record Layer provides a large currency control. Its architecture draws from the virtual set of extension points, allowing its clients to extend its synchrony paradigm [23, 26] whereby FoundationDB is com- functionality even further. For example, client-defined index posed of two logical clusters: one that stores data and pro- types can be seamlessly “plugged in” to the index maintainer cesses transactions and another coordination cluster (run- and query planner. Similarly, record serialization supports ning Active Disk Paxos [27]) that maintains membership and client-defined encryption and compression algorithms. configuration for the first cluster. This allows FoundationDB The Record Layer supports multi-tenancy
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages16 Page
-
File Size-