Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Zalando Engineering 8 min read Case study mediumAdept

From Event-Driven Chaos to a Blazingly Fast Serving API

Zalando replaced an event-driven pipeline that merged Product, Price and Stock events with a central Product Read API (PRAPI). During Cyber Week that pipeline delayed price and stock updates by up to 30 minutes, because over 90% of each payload was unchanged. PRAPI is a Caffeine async-loading cache over DynamoDB, run on Kubernetes with Netty/Epoll non-blocking I/O, and serves millions of requests per second at sub-10ms P99. Consistent hash load balancing in Skipper partitions the catalogue so small per-pod caches hold hot products. Fixed ring positions and a bounded-load cap of 2× the average keep caches warm during scaling and stop hyped products from overloading a pod. Tail latency came down by caching payloads as byte arrays to avoid GC pauses, using LIFO queuing, and splitting DynamoDB clients into a 10ms primary and a 100ms fallback. Adoption across ~350 teams worked because PRAPI served the legacy formats via the Accept header, and the org was restructured along CQRS lines.

Related posts

  • Client-Side Load Balancing at a Million Requests Per Second

    Zalando Engineering hardMaster

    Zalando moved the high fan-out internal traffic of its Product Read API (over a million requests per second at peak) off the shared Skipper ingress and onto an in-process client-side load balancer. The balancer reproduces Skipper's xxHash64 consistent-hash ring with 100 virtual nodes so caches stay aligned during migration, and discovers pods through a watch-based Kubernetes EndpointSlice informer with a 2-second debounce. Rollout ran behind percentage toggles with a transparent Skipper fallback. It flattened latency spikes and shrank Skipper's fleet from over 50 pods to 8, cutting daily node cost from about $450 to $110. Owning the balancer also enabled N-ring fade-in, which warms new pods with exactly the keys they will keep, and bounded load driven by per-pod occupancy (seconds of work per second) rather than in-flight counts. The work was made possible by first cutting median deploy time from 289 to 128 minutes.

  • Utilizing Amazon DynamoDB and AWS Lambda for Asynchronous Event Publication

    Zalando Engineering mediumAdept

    Zalando Payments decoupled event publication from synchronous DynamoDB writes in its Order Store service using the Transactional Outbox pattern, removing the message bus from the request path and raising the availability ceiling from 99.8% to DynamoDB's own. DynamoDB Streams act as the outbox, emitting old and new item images to a Python AWS Lambda that builds a data-change event with a diff patch and publishes it to Nakadi. Failed publishes retry with exponential backoff, then land in an SQS dead letter queue that a Kubernetes CronJob drains by rerunning the same code. The tradeoff is that event ordering is no longer guaranteed.

  • Enhancing Distributed System Load Shedding with TCP Congestion Control Algorithm

    Zalando Engineering mediumAdept

    Zalando's customer communication platform applies TCP-style AIMD (Additive Increase Multiplicative Decrease) congestion control at its ingestion point to shed load and prioritize critical messages. The Stream Consumer pulls events from Nakadi and watches RabbitMQ publish latency (P50) and publish errors as congestion signals. Each event type's throttle adjusts its consumption rate independently: higher-priority types increase faster and decrease less (e.g. +15/−20% for P1 vs +5/−60% for P3), so no central coordination is needed. After six months in production, order confirmations keep stable processing times while commercial messages absorb delays. RabbitMQ queues stay small, and backlog remains in Nakadi, where low-priority events can be discarded in an emergency.

  • Rapidly scaling online storage to serve over 1 billion ChatGPT users

    OpenAI mediumAdept

    Habitat, OpenAI's online storage platform, grew from a client-side Python library over Azure Cosmos DB into a centralized Python service handling 70M+ requests per second and 500+ PB across about 40 regions. It moved to a service because coordinating client-library rollouts across dozens of services had become slow and error-prone. Running Python at this scale meant fighting tail latency from asyncio event-loop scheduling delay, which the team measured directly and controlled by keeping per-process concurrency low and scaling out worker processes. Specific fixes included shrinking and jittering Statsig feature-flag config refreshes, and switching aiohttp's LIFO connection reuse to FIFO to break a metastable failure that concentrated load on already-slow processes.

  • Making Shopify’s Flagship App 20% Faster in 6 Weeks Using a Novel Caching Solution

    Shopify Engineering mediumAdept

    Shop's home feed, which aggregated orders and carrier tracking data and accounted for 30% of database load, was moved behind a custom write-through cache in Memcached, cutting database load by 15%, overall GraphQL latency by about 20% and CPU usage by a double-digit percentage. To handle concurrent order updates without serving stale data, each user has a pending-writes counter that workers increment before a database write and decrement after it. A short-expiry key detects crashed writers so the cache can be safely rewarmed. The logic was mixed into Active Record models as concerns, so the ORM API was unchanged. Correctness was validated in a shadow rollout that compared cache and database reads before serving from the cache.

The quest for software engineering knowledge.

Look:
Layout: