The Airbnb Tech Blog | Medium Note

The Airbnb Tech Blog | Medium

Airbnb Engineering is a portfolio of articles from Airbnb's engineering team discussing various technologies, innovations, and case studies of the industry. The site provides readers with in-depth analysis and insights into the different approaches and challenges they face in terms of software engineering, product development, scalability, performance, and more. The blog also covers new trends in technology, leadership, and team collaboration, offering wisdom for improving tech companies.

Thread Of Notes

CdXz5zHNQW_Xet1TCXtVb.jpeg
Airbnb emphasizes treating evaluation as a crucial engineering discipline for building trustworthy Generative AI products. Traditional software testing assumptions are challenged by the non-deterministic and subjective nature of LLM outputs, often requiring AI to evaluate AI. Product teams at Airbnb build LLM-powered features, supported by an infrastructure team providing tooling and best practices. A foundational principle is understanding that evaluation must be planned from the outset to avoid false confidence and undetected regressions. The "one rule" is to manually review data and build intuition for success by examining prototype outputs. This habit evolves into eval-driven development, where failure modes are discovered, encoded, and continuously tested. Key principles of eval-driven development include defining goals, letting real errors guide metrics, using small, sharp evaluator sets, appointing a decision-maker, and continuous collaboration. Three evaluation methods form layers: programmatic checks for obvious failures, LLM-as-a-Judge for nuanced quality, and human evaluation for edge cases and validation. Programmatic checks use deterministic code-based tests, while LLM-as-a-Judge employs stronger LLMs against rubrics, requiring calibration for trustworthiness. Human evaluation serves as the gold standard for ground truth and high-stakes decisions. For agentic systems, evaluation extends across multiple layers, examining reasoning paths and tool calls, not just the final output. A practical walkthrough demonstrates exploring initial failures, building layered evaluations with programmatic checks and calibrated virtual judges, and scaling with production monitoring. Key takeaways highlight the importance of looking at data, avoiding generic metrics, starting small, calibrating judges, using layered defenses, and mirroring evaluations in production. Ultimately, successful AI product development hinges on evaluation being a collaborative team sport that shapes the definition of product success.
CdXz5zHNQW_T3SelU9bHa.jpeg
CdXz5zHNQW_c4zzcDn3wz.jpeg
Shipping a production language model system requires rapid iteration on improvements, which is challenging due to the non-deterministic nature of models and evaluation processes. Airbnb addressed these challenges by building reliable LLM infrastructure across four layers, focusing on engineering enhancements and integration. The core principle is that the seams between components are where issues arise, and comprehensive end-to-end testing is crucial.Layer 1 focuses on diagnostic framing of evaluation noise, distinguishing between data and judging uncertainty to understand performance variations. Noise in LLM evaluations can stem from judges scoring inputs differently or LLM-generated references changing, making it difficult to discern true model improvements. Separating epistemic uncertainty (model/judge limits) from aleatoric uncertainty (task ambiguity) is key to accurate diagnosis.Layer 2 establishes a deterministic evaluation foundation by stabilizing inputs to judges. This is achieved through a per-sample cache for references and judge scores, ensuring identical inputs yield cached results and making evaluation reproducible and efficient. This deterministic measurement is essential for Layer 1's diagnostic capabilities.Layer 3 enables bounded, scoped model mutation through micro adapters. These are small LoRA patches trained on specific bugs, allowing for quick, hour-long training and hotfix-style deployments. Three lifecycle rules—fusing co-triggering patches, retraining on accumulation, and unloading unused patches—prevent the stack of adapters from degrading.Layer 4 provides end-to-end validation at the seams of the system. Despite individual components appearing fine, their interactions can cause unexpected behavior. This layer involves running representative inputs through the entire production path to measure combined quality and latency, ensuring that bugs at the seams are surfaced before deployment. These four layers form a dependency stack where each layer's effectiveness relies on the others.
CdXz5zHNQW_y2WUihSDGZ.png
CdXz5zHNQW_hwlCx2ZBf5.jpeg
Airbnb developed the sitar agent, a lightweight Kubernetes sidecar, to reliably deliver dynamic configuration changes to thousands of service instances. The configuration delivery begins with developers creating or updating values through Git or a UI, which are then stored in the Sitar Service. Periodically, the full state of configurations is packaged into compressed snapshots and uploaded to AWS S3. When a service pod starts, the sitar agent first downloads these S3 snapshots to a mounted disk, enabling a quick bootstrap. It then synchronizes with the Sitar Service for any changes made since the snapshot was created, signaling readiness to the main application container. After startup, the agent continuously polls the Sitar Service for updates every few seconds. The main application container reads configurations from the mounted disk using a Sitar client library that caches values and detects file changes. A key design decision was maintaining the sitar agent as a separate sidecar container rather than integrating it into the main container, prioritizing reliability, operational safety, and multi-language support over minor cost savings. The system uses a pull model where the agent polls the Sitar Service, optimized with a server-side cache and token-based database access to reduce load. For its local on-disk key-value store, Airbnb opted for SQLite over the legacy Sparkey-backed implementation due to SQLite's superior concurrency, performance, and multi-language support. SQLite's built-in Write-Ahead Logging allows concurrent reads during writes, and its simpler operational model was preferred over RocksDB's higher performance but greater complexity. This robust sidecar design ensures that critical configurations are delivered quickly and reliably across Airbnb's vast service fleet.
CdXz5zHNQW_7QO75wfm4Y.jpeg
CdXz5zHNQW_7QiYuy1bLj.png
CdXz5zHNQW_IA1cJHBdof.jpeg
Airbnb developed an internal storage system to handle 50 million samples per second and 2.5 petabytes of time series data. This shift was necessary due to the immense volume of data generated by extensive code instrumentation across their evolving products and infrastructure. The primary engineering challenge was to persist and serve this massive dataset performantly.To manage this scale, Airbnb adopted a multi-tenant architecture, isolating tenants by service or process for stable grouping and attribution. They implemented shuffle sharding to isolate tenant workloads, improving fault tolerance by ensuring tenants only write to and are queried from a subset of nodes. Operational complexity, especially tenant onboarding and configuration management, was addressed by a consolidated control plane that automated onboarding and simplified configuration updates.Key requirements for the system included handling over 50 million samples per second, supporting numerous dashboards and alerts, and maintaining low query execution times. Initial validation using shadow clusters revealed reliability issues, compaction delays, and slow query performance, especially with large data payloads. Addressing these challenges began with ensuring the reliability of a single cluster, focusing on stabilizing writes, reads, and compaction through benchmarking, guardrails, and isolation of query paths.The system was made fault-tolerant with zone-aware stateful components deployed across three zones. Per-replica limits and tenant-level controls were implemented for effective fleet management and system protection. Subsequently, a multi-cluster architecture was adopted to reduce the blast radius of failures and enhance flexibility.This multi-cluster approach, however, introduced complexities in metrics discovery, querying, and operational overhead. These were mitigated by tooling for tenant-cluster mapping and automated deployment strategies using Kubernetes operators. The introduction of Promxy with custom enhancements facilitated cross-cluster querying and alerting.Key learnings from this journey include the significant cost of cross-cluster querying and the importance of deployment consistency, achieved through automation and standardized deployments. The philosophy evolved towards treating clusters as disposable resources, similar to "cattle," rather than critical, unique "pets," allowing for easier scaling and maintenance. Ultimately, building this platform required a blend of architectural innovation, operational rigor, and a cultural shift in managing expectations.
CdXz5zHNQW_oUKNz5mUz5.jpeg
CdXz5zHNQW_p9tvPsoHId.jpeg
Observability as Code (OaC) at Airbnb defines alerts, dashboards, and SLOs through code, mirroring software development practices. While this process ensures disciplined alert definitions, validating alert behavior in production was a significant challenge. This gap led to either excessive alert noise or missed incidents, hindering developer workflow. To address this, Airbnb built accessible feedback loops for previewing and validating alert behavior before code submission. This innovation dramatically reduced development cycles from weeks to minutes. The company's OaC goal is for product teams to receive out-of-the-box monitoring from platform teams, achieving "zero touch" adoption. However, managing 300,000 alerts made iterating and validating OaC changes costly and risky. Traditional code reviews and unit tests could not predict how alerts would behave with real-world data, leading to a weeks-long validation process. Airbnb rebuilt its OaC platform focusing on local-first development, Change Reports, and bulk backtesting against historical data. This allowed engineers to validate alert templates quickly and efficiently. Key learnings included prioritizing compatibility over novelty, implementing robust guardrails, and owning the full development surface area for improved developer experience. The impact has been a successful migration of 300,000 alerts to Prometheus, collapsed development cycles, and a significant reduction in alert noise, fostering a culture of alert hygiene.
CdXz5zHNQW_p1JPMKjgtj.jpeg
CdXz5zHNQW_A3Qsjaew7k.png
Airbnb successfully launched over 20 locally relevant payment methods worldwide in just 14 months to enhance accessibility and reduce friction for guests. These Local Payment Methods (LPMs) include digital wallets, bank transfers, and local payment schemes, moving beyond traditional card payments. Offering LPMs boosts conversion, unlocks new markets with low credit card usage, and provides access for unbanked individuals. Through extensive research, Airbnb identified over 300 payment options and used a structured framework to select the top performers for integration.Airbnb's modernized payments platform, built on a domain-driven architecture, decoupled payment logic for flexibility and scalability. This replatforming effort, known as Payments LTA, shifted from a monolithic system to a services-oriented one, speeding up time to market. The processing subdomain, crucial for integrating third-party providers, adopted a connector and plugin-based architecture. This strategy, along with the introduction of Multi-Step Transactions (MST), significantly reduced integration time for new PSPs and standardized complex payment flows.The integration of LPMs presented challenges due to diverse APIs and the need for external app interactions. Airbnb analyzed end-to-end behaviors and standardized them into three foundational flows: Redirect, Async, and Direct. This unified framework enabled significant code reusability and reduced engineering effort for new payment method integrations. Asynchronous payment orchestration was redesigned to manage external user actions and webhook notifications for successful payments.A config-driven approach, utilizing a central YAML configuration, streamlined payment method integration by consolidating logic and enabling automated code generation. This made integration largely declarative, reducing launch times from months to weeks. The payment widget dynamically renders UI and validation rules based on backend configurations, ensuring a tailored checkout experience. Enhanced testability through an in-house PSP Emulator allowed developers to thoroughly test payment scenarios without relying on unstable external sandboxes.
CdXz5zHNQW_E1JU738XpJ.jpeg
Airbnb's key-value store, Mussel, originally used simple QPS rate-limiting to prevent single clients from overwhelming the system. As traffic grew and became more complex, this approach proved insufficient due to cost variance and traffic skew. To address this, Mussel evolved to implement a multi-layered quality of service (QoS) system. The first layer, Resource-Aware Rate Control (RARC), charges requests in Request Units (RU) that account for rows, bytes, and latency, reflecting the actual backend cost. This system uses token buckets with static RU quotas for each caller.The second layer, load shedding, provides real-time protection when capacity is strained or hotspots develop. It combines traffic criticality, a latency ratio indicating system stress, and a CoDel-inspired queueing policy. This allows high-priority traffic to remain responsive and gracefully backs off other traffic when latency increases. The third layer, hot-key detection and DDoS defense, identifies and mitigates surges of identical requests targeting specific data. It uses an in-memory top-k counter for real-time detection, local caching on dispatcher pods, and request coalescing to send only one request to the storage layer for duplicate hot-key lookups.These layered controls have significantly improved Mussel's ability to handle traffic spikes and maintain reliability. Key takeaways include the value of early impact for validating concepts, preferring local control loops for scalability, and employing mechanisms that operate on different time scales. This sophisticated QoS stack ensures Mussel remains fast and dependable, even under extreme and volatile traffic conditions.
CdXz5zHNQW_D4i1N1yN56.jpeg
CdXz5zHNQW_xJf1iLzWz1.jpeg
Viaduct, Airbnb's data-oriented service mesh, is now open-source. Over five years, Viaduct usage at Airbnb has grown significantly, with traffic increasing eightfold and the number of teams doubling. It continues to be guided by three core principles: a central schema, hosted business logic, and re-entrancy. The central schema integrates data across the company, making Viaduct a go-to data mesh. Hosting business logic directly in Viaduct, enabled by a serverless platform, simplifies operations for developers. Re-entrancy allows hosted logic to compose with other logic via GraphQL fragments and queries, maintaining modularity.A recent overhaul, "Viaduct Modern," addresses past complexities by simplifying the developer-facing Tenant API to two resolver types: node and field resolvers. This modernization also introduces tenant modularity, formalizing "tenant modules" as units of schema and code owned by a single team, composed via GraphQL. Framework modularity has also been improved, creating stronger abstraction boundaries between the GraphQL execution engine, the tenant API, and hosted code. The new engine API is dynamically typed, while the tenant API is statically typed, allowing independent evolution.Viaduct offers gradual migration by running both the Classic and Modern Tenant APIs on the new engine simultaneously. Other improvements include enhanced observability, faster build times through schema-first development and direct-to-bytecode generation, and a dispatcher for Kubernetes scaling and blast radius mitigation. Airbnb is open-sourcing Viaduct to benefit from community contributions and believes it can be valuable for both large-scale and nascent GraphQL projects. The Modern API is currently in alpha, but the new engine is in full production.
CdXz5zHNQW_Ry0cTKX3TG.jpeg
CdXz5zHNQW_YzRZpul0zT.jpeg
CdXz5zHNQW_deZowKwyHD.jpeg
Organizations traditionally used costly standalone servers with sharding for database scaling, but this approach proved problematic for maintenance as data demands grew. Running horizontally scalable, open-source databases reliably in the cloud with high availability, low latency, and scalability at a reasonable cost is a significant challenge. Airbnb adopted an innovative strategy of deploying a distributed database cluster across multiple Kubernetes clusters for improved reliability and operability. Managing stateful services like databases on Kubernetes is difficult, especially concerning node replacement and upgrades, as Kubernetes lacks data distribution awareness. To mitigate this, Airbnb attached storage volumes to nodes using AWS EBS, enabling automatic reattachment to new virtual machines via Kubernetes Persistent Volume Claims. Custom Kubernetes operators were developed to manage node replacement events, categorizing them into database-initiated, proactive infrastructure, and unplanned failures. For database-initiated and proactive events, operators ensure all nodes are running before replacement and intercept pod evictions to coordinate safe deletions. Unplanned failures cannot be coordinated, but ongoing maintenance is protected by blocking replacements until failed hardware is fixed. To ensure high regional availability, Airbnb deploys each database across three independent Kubernetes clusters in different AWS availability zones, limiting the blast radius of issues. Overprovisioning database clusters guarantees sufficient capacity even if an entire AZ, Kubernetes cluster, or all storage nodes in a zone go down. AWS EBS provides rapid reattachment for node replacements and superior durability, allowing a highly available cluster with only three replicas. Tail latency spikes in EBS are mitigated by implementing storage read timeouts and allowing reads from replicas to reduce latency and avoid cross-AZ costs, with stale reads further optimizing read performance. This multi-cluster Kubernetes strategy, leveraging AWS EBS and custom operators, allows open-source distributed storage systems to achieve high availability, low latency, and scalability in cloud environments, enabling robust data management.
CdXz5zHNQW_5ISBolXzut.jpeg
CdXz5zHNQW_IYTQREK32w.jpeg
Airbnb's system-level load testing is crucial for reliability and efficiency, identifying bottlenecks, evaluating capacity, establishing performance baselines, and detecting errors. Impulse is an internal load-testing-as-a-service framework that provides tools to generate synthetic loads, mock dependencies, and collect traffic data from production environments. Impulse includes four main components: a load generator, a traffic collector, a dependency mocker, and a testing API generator. The load generator allows service owners to conduct context-aware load tests, generating requests on the fly and mocking dependencies. The traffic collector captures both upstream and downstream traffic, allowing Impulse to accurately replay production traffic during load testing. The dependency mocker mocks downstream responses with latency, eliminating interference between services and reducing communication costs. The testing API generator creates HTTP APIs during the CI stage, enabling load testing tools to send traffic to these synthetic APIs, allowing asynchronous flows to be exercised as if they were synchronous. Impulse is designed to minimize manual effort, seamlessly integrate with Airbnb's observability stack, and empower teams to proactively address potential issues. The framework has received positive feedback, helping teams identify and address potential issues in their services. Impulse is currently being implemented in several customer support backend services and is under review with teams across the company.
CdXz5zHNQW_MMZuwGyO3E.jpeg
CdXz5zHNQW_ZoLewXZBkI.jpeg
Vijaya Kaza is the Chief Security Officer and Head of Engineering for Trust and Safety at Airbnb, leading teams that develop technology to safeguard the community and secure infrastructure. She is also the executive co-sponsor of Airbnb Tech's Diversity Council. Vijaya grew up in a large family in India, where she was expected to excel academically, and she developed a strong affinity for science and math, studying electrical engineering in college. After college, she landed a job at Cisco as a software engineer and accidentally stumbled into the security field, following a manager she liked. She spent 17 years at Cisco, leading product development for a $1 billion security product portfolio, and later worked at FireEye and Lookout, a startup in San Francisco focused on mobile security. Vijaya was approached for the CSO role at Airbnb, which she was initially hesitant about, but was impressed by the company's vision and mission. She joined Airbnb in 2019, drawn to the company's dedication to delivering a positive user experience and its mission-driven approach. Vijaya leads two teams, Trust and Safety and Security, which share the common mission of safeguarding users and the platform, but have different techniques, threats, and focus areas. Outside of work, Vijaya has pursued improv comedy, which has taught her valuable leadership lessons, such as thinking on her feet and responding to new scenarios in the moment. She advises others to maintain focus, keep a steady head, and persist forward undeterred in the face of professional setbacks.
Airbnb recently adopted Bazel, Google's open source build tool, as their universal build system across backend, web, and iOS platforms. The company's large-scale web monorepo, consisting of over 11 million lines of code, presented challenges with bespoke build scripts and caching logic that were difficult to maintain and scaled poorly. To address these issues, Airbnb migrated to Bazel, which offered sophistication, parallelism, caching, and performance. The migration process began in 2021, but there was no publicized industry precedent for integrating Bazel with web at scale outside of Google. The team had to overcome performance issues when transmitting large files to the remote environment and established migration principles that included improving or maintaining overall performance and reducing the impact on developers contributing to the monorepo during the transition.To prepare the repository for Bazel, the team performed cycle breaking and automated BUILD.bazel file generation. They also migrated CI jobs to Bazel, starting with type checking, linting, and unit testing. The team enabled TypeScript, ESLint, and Jest, and introduced caching to reduce input size and improve performance.To prevent backsliding, the team moved tests from "hidden" to "required" via a rule attribute and ensured a single source of truth by not running tests under the Jest setup being replaced. They also wrote a script to compare before and after Bazel to determine migration-readiness using metrics such as test runtime, code coverage stats, and failure rate.In tandem with the CI migration, the team ensured that developers can run Bazel locally to reproduce and iterate on CI failures. They delivered a local Bazel experience that is on par with or superior to the existing developer experience and performance, allowing developers to continue using familiar tools and opt into Bazel when beneficial.
Airbnb has transformed the way people travel around the globe, but providing guests with relevant options in their search results has become increasingly complex due to the diverse locations and property types in their inventory. To address this challenge, Airbnb shifted from using simple heuristics to advanced machine learning and reinforcement learning techniques to transform their location retrieval process. Initially, Airbnb relied on heuristics to define map areas based on the type of search, but these heuristics had limitations and couldn't differentiate between different types of searches or adapt well to new data. Airbnb then explored statistics to improve location retrieval by building a dataset for each travel destination that recorded where guests booked listings when searching for that destination. However, this statistical approach still had limitations and treated all searches for a location the same, regardless of specific search parameters. This led Airbnb to believe that location retrieval may require more advanced techniques such as machine learning. Airbnb constructed a machine learning model that could learn from various search parameters, such as the number of guests and stay duration, and predict more relevant map areas for each search. The machine learning system increased the recall of booked listings by 7.12% and reduced the size of the retrieval map area by 40.83%, resulting in a cumulative impact of +1.8% in uncancelled bookers on the platform. Airbnb then introduced reinforcement learning to the location retrieval process, allowing the system to continuously learn from guest interactions and adjust the retrieval map area based on guest booking behavior. The reinforcement learning system successfully explored more for less-traveled locations and explored less for locations that are often searched and booked, resulting in a cumulative 0.51% increase in uncanceled bookers and 0.71% increase in 5-star trip rate. Airbnb's journey from simple heuristics to sophisticated machine learning and reinforcement learning models demonstrates the power of data-driven approaches in transforming complex systems. The transformation cumulatively results in a 2.66% increase in uncanceled bookers, a major achievement for a company operating at Airbnb's scale.