Skip to content
Chaos Lab

Challenge 62 · intermediate · Delivery platform

One zone, one partition

150 orders a second are placed and published to order-events, which has 12 partitions keyed by zone. Dispatch consumes it with 4 pods, and autoscaling on lag is on.

At 10 seconds a match ends and 70% of all orders come from the zone around the stadium. The total does not change. From 30 to 90 seconds, dispatch may be at most 15 seconds behind for any order.

ready00:00 / 01:30Success · 10 s–p99 · 10 s–order-events lag0 ordersKafka76k msg/sDispatch4 pods

Service map

Delivery platform · paused
no timeout75k pings/sCustomers of a quick-commerce app: about 10 minutes from order to door.300,000 riders online, each carrying about 1.5 orders at a time: room for 450,000 orders in flight. The ×3 surge needs 270,000.Customer traffic only. Riders connect through their own location gateway.Catalog and search reads: 85% of the customer API traffic.Answers 92% of catalog and search reads; the rest go to the catalog's own index.Cart, checkout and order status. Placing an order reserves stock, authorises payment, then commits the order and an outbox row in one transaction.Holds stock for an order at checkout, so two customers cannot buy the last unit.Every attempt for one order carries the same idempotency key, so a retry after the 2 s timeout cannot charge twice.The order and its outbox row commit together, so an event exists exactly when the order does.Reads the database log (change data capture) and publishes each outbox row to order-events. Orders never writes to Kafka itself.Partitioned by zone. 4 events per order. The lag shown is the dispatch group's backlog of orders.12 partitions → at most 12 consumers (classic consumer groups; Kafka 4.2 share groups lift this limit). Scaling out pauses consumption while partitions rebalance, so pre-scale before the dinner peak.Riders hold one long-lived connection each and stream positions over it. Separate from the customer API gateway.One position per rider every 4 s. Most of the messages in Kafka, and none of the lag.The only writer of the rider index.last-seen ZSET + sweeper evicts riders silent >30s; sharded by city. Written by the location service, read by dispatch.Pushes each rider's position, and order status, to the customers waiting on that rider: one socket per order in flight.
All components healthy.requestretrytrial call (half-open)failed

What changed

Turn on a fault or change a defence while the run plays. Its effect shows here: the 5 seconds before against 5 seconds after it settles.

Goal · measured 00:30–01:30

0 changes · par 1
  • Furthest behind on order-events ≤ 15 smeasuring from 00:30
  • Orders with a rider inside a minute ≥ 99.0%measuring from 00:30

This is a simulation. Its numbers come from a model of a typical system, not from measuring real servers. The same link and seed always give the same run. How the Chaos Lab works.