Big Billion Days morning. The product page of the hot phone is one Redis key with a 20 second TTL, read 3,000 times a second. Building that page is a heavy query: Postgres manages about 300 of them a second, runs at most 100 at once, and gives up on any request older than 2 seconds. The numbers are made up and round, and time is real time. Expire the key and watch what reaches Postgres under each protection.
Read scenario overview
- Components: Shoppers (source); App 1 (server): capacity 3,000/s, 15 ms; App 2 (server): capacity 3,000/s, 15 ms; App 3 (server): capacity 3,000/s, 15 ms; Redis (cache): capacity 1,00,000/s, 1 ms; Postgres (db): capacity 300/s, 40 ms.
- Traffic: starts at 3,000 requests/second (slider range 0 to 6,000/s).
- Interactive controls: Expire the key now, Protection. Servers and database can be stopped and restarted by clicking them.
The demo shows what breaks. The lesson explains why it breaks, and what you give up with each fix.
This demo is free. The System Design pass (₹499) opens all 28 demos, 36 design interview problems and 75 Docker labs. See what the pass includes →