- Mailing Lists
- in
- How Airbnb Built a Key-Value Store for Petabytes of Data
Archives
- By thread 4560
-
By date
- June 2021 10
- July 2021 6
- August 2021 20
- September 2021 21
- October 2021 48
- November 2021 40
- December 2021 23
- January 2022 46
- February 2022 80
- March 2022 109
- April 2022 100
- May 2022 97
- June 2022 105
- July 2022 82
- August 2022 95
- September 2022 103
- October 2022 117
- November 2022 115
- December 2022 102
- January 2023 88
- February 2023 90
- March 2023 116
- April 2023 97
- May 2023 159
- June 2023 145
- July 2023 120
- August 2023 90
- September 2023 102
- October 2023 106
- November 2023 100
- December 2023 74
- January 2024 75
- February 2024 75
- March 2024 78
- April 2024 74
- May 2024 108
- June 2024 98
- July 2024 116
- August 2024 134
- September 2024 130
- October 2024 141
- November 2024 171
- December 2024 115
- January 2025 216
- February 2025 140
- March 2025 220
- April 2025 134
How Airbnb Built a Key-Value Store for Petabytes of Data
How Airbnb Built a Key-Value Store for Petabytes of Data
How to Diagram Your Cloud Architecture (Sponsored)Get best practices from AWS solutions architects for diagramming your cloud architecture. Disclaimer: The details in this post have been derived from the Airbnb Technical Blog. All credit for the technical details goes to the Airbnb engineering team. The links to the original articles are present in the references section at the end of the post. We’ve attempted to analyze the details and provide our input about them. If you find any inaccuracies or omissions, please leave a comment, and we will do our best to fix them. Airbnb's services rely on more than just raw data. They also depend on derived data. But what is derived data? It is information computed from massive offline datasets processed by tools like Spark or real-time event streams from systems like Kafka. This derived data is crucial for enabling personalized features, such as tailoring a user’s experience based on activity history and other similar features. See the diagram below that shows the role of derived data in Airbnb’s overall service architecture. However, accessing this data efficiently poses unique challenges.
This is where Mussel comes in. Built to meet these stringent requirements, it’s a key-value store designed to ensure Airbnb’s services can retrieve the right data at the right time. In this article, we’ll understand the architecture of Mussel and learn how Airbnb built this key-value store to manage petabytes of data. Evolution of Derived Data Storage at AirbnbMussel wasn’t the first solution that Airbnb used to store derived data. Before the brand-new key-value store became a reality, there were other solutions implemented by the Airbnb engineering team. Let’s go through the main stages of this evolution: Stage 1: Unified Read-Only Key-Value StoreDuring the early stages of Airbnb's journey to handle derived data effectively, they faced several technical challenges. Existing tools like MySQL, HBase, and RocksDB couldn't meet the demanding requirements such as:
To address these needs, Airbnb created HFileService in 2015. It was a custom solution built using HFile, which is a building block for HBase and based on Google’s SSTable. See the diagram below for the architecture of HFileService: Here's how it worked:
While HFileService solved many problems, it had significant limitations:
Stage 2: Real-Time and Derived Data Store (Nebula)In the second stage of evolution, Airbnb introduced Nebula, a system designed to bridge the gap between batch-processed data and the growing need for real-time data access. See the diagram below to understand the architecture of Nebula. Nebula brought several important enhancements to improve upon the limitations of its predecessor, HFileService.
Despite the advantages, Nebula also had some limitations such as:
Mussel ArchitectureIn 2018 the Airbnb engineering team built a new key-value store called Mussel. The architecture of Mussel was designed to address the scalability and performance limitations of previous solutions. See the diagram below that shows the architecture of Mussel: Let’s look at each feature of Mussel’s architecture in more detail: Partition Management with Apache HelixMussel increased the number of shards (data partitions) from 8 to 1024 to support Airbnb’s expanding data needs. These shards are smaller subsets of data distributed across multiple servers, ensuring that no single server is overwhelmed by too much data. The data was partitioned into those shards by the hash of the primary keys. They used Apache Helix to automate the management of these shards. It determined which physical servers stored each shard and balanced the load dynamically. This removed the need for manual intervention, making the system more efficient and scalable. Leaderless Replication with KafkaMussel used Kafka as a write-ahead log for every write operation. Kafka divided the log into 1024 partitions, aligning with the shard structure in Mussel so that each shard’s data was processed in order. This ensured that all updates were recorded and replicated consistently. Mussel also followed a leaderless replication approach. Unlike systems with a designated “leader” node for each shard, Mussel allowed any node holding a shard replica to handle read requests. Write operations, however, synchronized across nodes using Kafka logs to maintain consistency. This design smoothed out spikes in write traffic and prioritized high availability for read-heavy workloads common at Airbnb. The data was eventually consistent, but it was acceptable for the derived data use cases. Unified Storage Engine with HRegionMussel replaced DynamoDB, simplifying the architecture by extending HFileService to handle real-time and batch data in a unified system. Instead of HFile, Mussel used HRegion, a component of HBase, as its key-value storage engine. This was because HRegion offered:
In HRegion, each client table was mapped to a column family. This grouped related data logically and helped Mussel support advanced queries such as:
Over time, HRegion created multiple small files from writes and deleted or expired data. To optimize performance, these files needed to be merged using a process called compaction. Mussel divided its nodes into:
Helix managed scheduled rotations between these node types, ensuring the system maintained high read availability and efficient compaction. Bulk Load SupportThey supported two types of bulk load pipelines from the data warehouse to Mussel via Airflow jobs:
Mussel used Spark to process data from Airbnb’s data warehouse, converting it into HFile format. These files were uploaded to S3 (cloud storage), where each Mussel storage node downloaded and loaded them into HRegion using the bulk loading API. Instead of reloading the entire dataset daily, Mussel loaded only the incremental changes (delta data). This reduced the daily data load from 4TB to just 40–80GB, significantly improving efficiency and reducing operational costs. Adoption and Performance of MusselMussel has become a core component of Airbnb’s data infrastructure, supporting a wide range of services that rely on key-value storage. It serves as the backbone for applications requiring reliable, low-latency access to derived data. Some performance metrics regarding Mussel are as follows:
ConclusionMussel demonstrates the evolution of a robust key-value store, addressing critical challenges like scalability, low latency, and operational complexity. Its impressive metrics and widespread adoption within Airbnb demonstrate how it has become a critical enabler for high-performance data-driven services. Mussel serves Airbnb’s current use case quite well. However, the Airbnb engineering team is also committed to enhancing Mussel to support use cases such as read-after-write consistency, auto-scaling, and traffic-based repartitioning. References: SPONSOR USGet your product in front of more than 1,000,000 tech professionals. Our newsletter puts your products and services directly in front of an audience that matters - hundreds of thousands of engineering leaders and senior engineers - who have influence over significant tech decisions and big purchases. Space Fills Up Fast - Reserve Today Ad spots typically sell out about 4 weeks in advance. To ensure your ad reaches this influential audience, reserve your space now by emailing sponsorship@bytebytego.com. © 2025 ByteByteGo |
by "ByteByteGo" <bytebytego@substack.com> - 11:36 - 7 Jan 2025