</> MAANG.io
system design · 301

Advanced

Master system design interviews with scalable architecture patterns, distributed systems, and real-world design challenges.

0/480 solved 0% complete

Section 6: One Log, Two Tiers - High-Level Architecture

Executive Summary: This section turns the Section 5 data model into running boxes. One outbox-fed Kafka log feeds one indexer, which writes closed rides into Cassandra time buckets and keeps open rides in a Redis live tier. A stateless query service reads the live tier first, then the buckets, and pages the result. We walk Maya's ride in and the 17:10–17:40 Market Street query out, then justify every box with a number and every missing box with a trigger.

The interviewer slides the marker across: "You've got tables. Now show me how a ride gets into them and how a query gets out." Section 3 already told us what this system is: writes are small (about 1,750/s at peak), reads and result sizes are the hard part (6,000 QPS peak, up to about 167K rows for a busy hour), and open rides are a small hot set (about 1M at peak, about 0.3 GB). Draw that and nothing more.

The Whole System on One Whiteboard

Active-events architecture: trip service outbox feeds a Kafka log consumed by the indexer (Cassandra buckets and Redis live tier) and the archiver (object storage); the query service reads Redis then Cassandra, the export service reads object storage and recent Cassandra days, and a reaper closes rides open over 12 hours

Two lanes: the write path (one producer, one log, two consumers) and the read path (one stateless service asking two stores in the right order). Exports and the reaper are side doors the hot path never waits on.

Sign in to continue reading

The rest of this lesson is available with a free account. Signing in with Google or Microsoft is free.

Sign in to read the full lesson

Sign in to MAANG.io

Use your Google or Microsoft account — no password to remember.

Continue with Google Continue with Microsoft

Please accept the terms above to continue.