Preparing your design workspace

Loading the problem and your latest saved attempt…

Design Consumer-Outage Backlog Recovery

Keep a durable event stream safe and recoverable when consumers stop while producers continue publishing.

Problem statement

A durable event stream has healthy producers, but one consumer group can be unavailable for hours. Producers must continue when capacity permits, while finite broker disks must not fill silently or destabilize unrelated workloads.

Design backlog admission, storage, retention, consumer recovery, and operational controls. For this exercise, assume at-least-once delivery, idempotent downstream processing, three broker replicas across failure domains, and a durable object-storage tier for older retained segments.

The system may throttle or reject producers when its explicit safety limits are reached; it must never report an event as durably accepted and then discard it merely because the consumer is down.

Cross-region active-active replication, arbitrary stream processing, and redesigning the producer's business workflow are outside scope.

What to build

  1. Accept producer events durably while the consumer group is unavailable, subject to explicit per-tenant and per-partition capacity limits.
  2. Keep broker storage within safe watermarks by moving closed segments to a durable tier and applying backpressure before disks are exhausted.
  3. Resume consumption from committed offsets, preserve partition order, tolerate duplicate delivery, and drain the backlog without overwhelming dependencies.
  4. Expose lag, retention headroom, drain estimates, and failure state so operators can pause, throttle, scale, or isolate the affected workload.

At scale

  • For this exercise, assume 100,000 events per second normally and 200,000 events per second at peak, with an average event size of 2 KiB.
  • For this exercise, allow a consumer outage of up to four hours and retain three days of acknowledged events in the durable tier.
  • For this exercise, keep four hours of closed segments on broker-local hot storage and begin protective throttling before any broker exceeds 75 percent disk utilization.
  • For this exercise, a recovered consumer fleet can process 300,000 events per second in total, while producer traffic continues at the normal rate.
  • Acknowledged events must survive one broker or one availability-zone failure, and producer acknowledgement latency should remain below 150 milliseconds at p95 while capacity is healthy.