The Outage Is Over — Now Bring It Back
Hard · system design problem
The database comes back after ten minutes down — cold, at half capacity. Two million devices flush their offline queues at once, the cache has expired, and the backlog must be gone before the next shift. Recover too fast and you are down again.
Inspired by the many outages whose recovery took longer than the outage itself. Your PostgreSQL has been down for ten minutes. Devices buffered their readings offline; the web dashboard has been showing errors. At T+30s the database returns — cold: half capacity for two and a half minutes while its buffers warm — the cache has expired, and every device flushes its offline queue at once (devices ×3 for a minute; their firmware retries 3×). Device readings flow through Kafka and device-writers into PostgreSQL (they may land up to 30 minutes late); device reads and the dashboard hit the API through Redis, all on one PostgreSQL primary. The run is graded from the moment the database returns: people (the dashboard) and devices must be served, and by the end the device backlog must be draining.
Topics
More
Codelays runs in your browser: turn on JavaScript to use it.