How Klaviyo Scaled Its Global Event Pipeline to Process 22.7 Billion Messages Using Amazon MSK Express

The modern e-commerce landscape is defined by the velocity of data. For Klaviyo, a leading B2C customer relationship management (CRM) platform, the ability to process trillions of data points in real time is not merely a technical requirement; it is the core of their value proposition to over 200,000 global brands. In late 2025, faced with the impending surge of Black Friday and Cyber Monday (BFCM), Klaviyo’s engineering team successfully executed a high-stakes transition from a legacy RabbitMQ-based infrastructure to Amazon Managed Streaming for Apache Kafka (Amazon MSK) Express brokers. This migration enabled the platform to ingest roughly 3 billion daily events—ranging from simple email opens to complex cart abandonments—with a level of elasticity that allowed for a five-fold increase in capacity during the peak holiday shopping window.
The Architecture of Scale: From RabbitMQ to Kafka
For years, Klaviyo’s event infrastructure relied on RabbitMQ. While robust during the platform’s early growth phases, the system began to show signs of strain as event volumes reached massive proportions. The challenge was clear: the existing infrastructure struggled to maintain the necessary throughput during sudden, intense traffic spikes. As the engineering team looked toward the 2025 holiday season, they identified a need for a system capable of sustaining a baseline of 170,000 events per second, while simultaneously possessing the headroom to absorb a seven-fold spike in traffic without compromising performance or incurring prohibitive costs.
The transition to Apache Kafka, specifically utilizing Amazon MSK Express brokers, provided the solution. By re-architecting the event gateway as a distributed, priority-based streaming pipeline, Klaviyo transformed how its system manages the ebb and flow of global e-commerce traffic. This shift was not just a change in technology, but a fundamental redesign of how customer data enters the Klaviyo ecosystem.
Chronology of a Holiday Migration
The timeline of Klaviyo’s migration reflects a meticulous approach to large-scale system reliability. Throughout the first nine months of 2025, the platform operated on a steady-state fleet of 12 brokers, efficiently processing approximately 3 billion events per day. Recognizing the inevitable pressure of the Q4 holiday cycle, the team initiated a strategic capacity expansion in early October 2025, increasing the fleet to 18 brokers.
As the retail industry entered the critical BFCM window in late October and November, the infrastructure was scaled up significantly to 60 brokers. This surge capacity allowed Klaviyo to manage the peak load seamlessly. Following the conclusion of Cyber Monday, the team executed a disciplined scale-down process throughout December, returning to an optimized steady-state of 18 brokers. This operational agility—the ability to expand and contract infrastructure on demand—was made possible by the unique features of Amazon MSK Express.
The Operational Mechanics of MSK Express
The transition to MSK Express was driven by three primary operational advantages that allowed Klaviyo to maintain a lean engineering team while operating at massive scale.
First, the elimination of manual storage provisioning removed a significant bottleneck. In traditional streaming setups, engineers must carefully forecast and provision storage to match expected peak loads, a process that often results in significant over-provisioning and wasted costs. MSK Express’s pay-as-you-go model, which charges based on data ingested and stored per gigabyte, allowed Klaviyo to align its costs directly with its actual traffic volume.
Second, the introduction of Intelligent Rebalancing solved one of the most notorious challenges in Kafka management. Traditionally, adding brokers to a cluster requires a complex and manual redistribution of partition data, which can lead to performance degradation if not managed with extreme precision. MSK Express automates this process, rebalancing partitions significantly faster than standard brokers. This automation ensured that Klaviyo could scale up for BFCM without requiring dedicated engineering time to manually manage cluster partitions.
Third, built-in high availability provided a safety net. Express brokers are designed for faster failure recovery, minimizing the time it takes for a node to rejoin the cluster. By offloading the management of cluster and topic configurations to the AWS-managed service, Klaviyo’s team could focus on application-level logic rather than infrastructure maintenance.

Priority-Based Processing: A Cost-Efficiency Breakthrough
One of the most innovative aspects of Klaviyo’s new architecture is its priority-based event processing. Rather than treating every event with the same urgency, the platform utilizes a gRPC publisher proxy to categorize events into priority tiers. High-priority events, such as purchase confirmations that trigger time-sensitive transactional emails, are prioritized in the stream. Conversely, lower-priority events, such as batch analytics updates, are handled with a slightly higher latency tolerance.
By running a unified set of processors across all three priority levels, rather than maintaining separate infrastructure for each, Klaviyo achieved a 30% reduction in costs through superior resource utilization. This consolidation is a hallmark of modern, efficient cloud architecture, demonstrating that scale does not always require a linear increase in overhead.
Resiliency and Failure Management
In a system processing billions of events, failure is an inevitability, not a possibility. Klaviyo designed its event publisher to be inherently resilient, incorporating multiple fallback mechanisms to prevent data loss. If a publish request fails against one Kafka cluster, the system automatically attempts recovery. In the rare instances where automated recovery is not possible, events are preserved for later replay.
Data from the company’s internal testing and production monitoring shows the effectiveness of this design: in a three-month period processing roughly 300 billion events, only about 20,000 events required recovery, and this was achieved without any human intervention. This high level of automation is essential for maintaining the integrity of customer data while reducing the operational burden on staff.
Implications for the Broader E-commerce Sector
The success of this migration has broader implications for the e-commerce technology sector. As digital storefronts continue to demand higher levels of personalization and real-time interaction, the underlying streaming infrastructure becomes a competitive differentiator. Klaviyo’s ability to handle 22.7 billion messages during the BFCM period—a 25% year-over-year increase—illustrates the capacity requirements of modern CRM platforms.
Furthermore, the shift toward fully managed streaming services like Amazon MSK suggests a trend toward "infrastructure-as-code" and "serverless-adjacent" operations, where the goal is to reduce the operational surface area of the core product. For companies like Klaviyo, the decision to migrate was described by the engineering team as one that "keeps paying dividends," freeing up engineers to focus on product features that drive revenue for their clients rather than the plumbing of the data pipeline.
Future Outlook
Klaviyo’s roadmap indicates that the use of Amazon MSK will continue to expand. The platform has already transitioned its change data capture (CDC) infrastructure to MSK Express and is actively evaluating the migration of its remaining self-managed Apache Kafka clusters, which currently support data lake workloads.
By prioritizing elastic scalability and operational simplicity, Klaviyo has established a blueprint for other high-growth companies. As the volume of global e-commerce data continues to climb, the ability to scale infrastructure in lockstep with business demand will remain the defining characteristic of successful platforms. For teams operating Apache Kafka at scale, the Klaviyo case study serves as a compelling argument for the adoption of managed services that prioritize automation and intelligent resource allocation.
As the industry looks toward the next peak shopping season, the lessons learned by the Klaviyo team—the importance of tiered processing, the value of automated rebalancing, and the necessity of resilient failure capture—will undoubtedly influence the next generation of real-time streaming architectures. Through this strategic investment in infrastructure, Klaviyo has not only secured its ability to handle current traffic but has also built a foundation that can scale to meet the demands of the digital economy for years to come.







