The Desi Architect
Notes / Browser demos
Try it in your browser

Interactive demos

Break a small model of a real system, then read why it broke. 28 demos, 10 free. No sign-in needed for the free ones.

APIs

Caching

Free Interactive demo

One hot phone, one key, one expiry

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.

Lesson: Caching Strategies: Cache-Aside & Write-Through
Free Interactive demo

Cache Stampede: The Thundering Herd Problem

When the Redis cache key for the IPL Final score expires at 10:00 PM, 500 concurrent users hit refresh at the same second. Compare Naive Cache-Aside vs Single-Flight Mutex to see how to prevent database collapse.

Lesson: Cache Invalidation & Stampede
Paid Interactive demo

One viral clip, one cache purge

IPL match highlights clip. 5,000 viewers a second ask three edge caches (Mumbai, Delhi, Bengaluru) for the same video manifest. Steady hit ratio is 98 percent, so App Origin sees only 100 requests a second against its 600 capacity. The numbers are made up and round. Purge the CDN cache at peak and watch what reaches the origin under each protection.

Lesson: CDN & Edge Computing
Paid Interactive demo

Flash sale memory trap

Big Billion Days morning. Shoppers send 3,000 requests a second (2,500 reads and 500 cart writes) to a catalog app. Redis has a 100 MB maxmemory limit. Postgres handles 400 queries a second. The numbers are made up and round. Fill cache memory to 100 percent and compare what happens under each maxmemory-policy.

Lesson: Eviction Policies

Real-time systems

Resilience

Data

Free Interactive demo

The search that ate the checkout

Friday night 9 PM on a food delivery app. Shoppers generate 1,000 requests a second: 800 browse searches and 200 checkout orders. Postgres has a 50-connection pool limit and normal queries take 5 ms. The numbers are made up and round. Trigger an unindexed search for %biryani% and compare how shared versus bulkheaded pools protect order revenue.

Lesson: Database Connection Pooling
Free Interactive demo

Swiggy menu-cache nodes on IPL night

Sixty restaurant menus are cached across a few nodes. Add a node, remove one, or switch on virtual nodes, then compare how many keys had to move on the ring against plain hash(key) % N.

Lesson: Consistent Hashing
Free Interactive demo

Where did my balance update go?

UPI balance checks and transfers. 2,000 requests a second hit two app servers: 500 writes (transfers) and 1,500 reads (balance inquiries). Writes go to Postgres Primary. Reads go to Postgres Replica. The numbers are made up and round. Trigger replication lag to see read-your-writes break, or stop Primary to watch leader failover.

Lesson: Database Replication
Paid Interactive demo

One hot match, one burned shard

Hotstar live match counter. India is chasing 280 against Pakistan, so match 42 receives 75 percent of all counter writes (3,000 writes a second). The remaining 1,000 writes a second spread across other matches. Four database shards each handle 1,000 writes a second. The numbers are made up and round. Switch routing strategies and watch what happens to Shard 2.

Lesson: Database Sharding

Case files

Free Interactive demo

Uber / Ola H3 Hexagonal Driver Dispatch

Drag or click anywhere on the Bengaluru map to position the Rider. Select search radius (Ring 1 or Ring 2) and hit Dispatch Rider . Watch H3 resolve 6 equidistant neighbors in O(1) time without scanning the database. Distances and times shown are illustrative.

Lesson: Geo Family: Geohash, Quad Trees, R-Trees & H3
Free Interactive demo

Two carts, one packet of Amul butter

A Blinkit-style dark store has exactly one packet left. Asha and Ben both press Pay. Pick a strategy, then move each cart one step at a time, or run a ready-made order. Try the unlucky order on the naive strategy first.

Lesson: Design Movie Ticket Booking (LLD)
Paid Interactive demo

Two cousins, one wedding guest list

Priya is on a flight with no Wi-Fi. Rohan is at the wedding hall with spotty connectivity. Both edit the same shared guest list offline. Pick a merge engine, step their local keystrokes, and watch how the server reconciles concurrent edits.

Paid Interactive demo

NSE 9:15 AM open on Reliance order book

The market opens with high-velocity orders flooding the exchange matching engine. Watch price-time priority determine fills, handle partial matches, and see how a cancel request loses the race against an incoming cross.

Paid Interactive demo

Tatkal Booking at 10:00 AM: Atomic Leases vs Naïve Race Conditions

Explore how high-concurrency booking engines (IRCTC, BookMyShow) prevent double-booking. Tap any available berth to acquire a 10-second hold. Initiate UPI payment, test rival races, arm server crashes, and toggle between Production Architecture and Naïve Lock to see exactly which race condition sells a seat twice.

Lesson: Design Movie Ticket Booking (LLD)
Paid Interactive demo

Rank is a sum: ask every shard how many teams are above you

Move the slider to change your team's score, or press Wicket (+25) . Each shard answers one question, "how many teams have a strictly higher score?", and your rank is those four answers added together plus one. The real design uses 16 shards. Four are drawn here so the arithmetic fits on a screen, and the scores follow an illustrative bell curve over 1 crore teams.

Messaging

Paid Interactive demo

Four partitions, five workers

Swiggy New Year's Eve dinner rush. 2,000 orders a second pour into an orders topic divided across 4 partitions (500 orders a second per partition). Each worker in the order-workers consumer group handles 500 messages a second. The numbers are made up and round. Add consumer workers and watch the throughput ceiling.

Lesson: Message Queues Deep Dive
Paid Interactive demo

Brokers that die, and consumers that crash at the wrong moment

Part 1 is one partition with RF=3. Switch brokers off and produce payment events with different acks. Part 2 is a consumer group reading three UPI partitions. Commit, crash and rebalance in different orders and watch the counters.

Lesson: Message Queues Deep Dive
Paid Interactive demo

Salary-day UPI events: size the topic with arithmetic you can see

Move the sliders and read the sums under each number. These are planning estimates for a first draft. Real clusters need a load test with your own payloads, because compression, skew, batching and disks change everything.

Lesson: Message Queues Deep Dive
Paid Interactive demo

Diwali blast vs one login OTP

Fire the blast, then request an OTP while it drains. Workers send 40,000 messages a second in total. One second of simulation passes every 20 ms.

Paid Interactive demo

Payment captured, order confirmed: two ways to tell the order service

Both sides get the same orders and the same broker. Left: save the order, then publish. Right: save the order and an outbox row in one transaction, and let a relay publish. Kill the broker, crash the relay, and watch what each side loses or repeats.

Lesson: Event-Driven Architecture

Traffic