Cruxly

Cruxly › System design › Running the Design Interview

The First Diagram

smallest system that meets the numbers

Open the interactive lesson

Now you draw — but you draw the simplest thing that satisfies the requirements and the estimates, and nothing more. Every box must be justifiable by pointing at a number you already wrote down.

Start embarrassingly simple

Your first diagram should be small enough that it feels like you are underselling yourself:

clients → load balancer → stateless app servers → database

That is it. No cache, no queue, no search cluster, no CDN.

This feels risky. It is not — it is the strongest opening available, for two reasons:

:::key The arithmetic of boxes

:::

Grow by breaking it

Attack your own diagram in a fixed order, and only add a box when the attack lands. Watch it grow:

clients LB app servers stateless database START HERE — four boxes, and it is genuinely correct shard 2 shard 3 50k writes/s > one primary cache 80 ms of DB time per read replica primary dies → conversation down queue workers 10⁷ fan-out is not synchronous Four boxes became nine — and every one of the five additions has a number behind it.
Each box appears only when a specific attack lands. That sequence — problem stated, then box drawn — is the whole technique.
#AttackWhat you sayWhat you add
1Traffic"At 50,000 writes/s a single primary is several times over"Partition by conversation ID
2Storage"700 TB/year doesn't sit on one volume, and reads are almost all recent"Tiering to object storage
3Latency"A feed read does eight queries — 80 ms of database time"A cache, and say what's in it
4Failure"If a shard's primary dies, that conversation is down"Replication and failover
5Spikes"A push fan-out at 10⁷ is not a synchronous request"A queue and a worker pool

:::key The rule that keeps this honest

:::

Define the contract at each hop

@@ 1 | Direction and protocol

:::key The observation worth more than the whole diagram

:::

@@ 2 | Payload shape

POST /messages
{ "conversation_id": "c_88", "client_message_id": "uuid-v4", "body": "..." }
→ { "server_id": "m_4471", "timestamp": 1731000000 }

@@ 3 | Failure behaviour

Stateless is the property that buys scaling

user load balancer request 1 instance 1 instance 2 instance 3 request 2 — different instance reads a signed token — succeeds identically no state to find here either — it just works Any instance can serve any request — because none of them are holding anything the request needs.
Statelessness isn't an architectural virtue for its own sake — it's specifically what makes "any instance, any request" true.
StateWhere it must liveIf you get it wrong
Session / authA signed token the client carries, or a shared cacheInstance memory means a user logs out when a box restarts
Uploads in progressObject storage keyed by upload IDLocal disk means a failed instance loses the upload
Rate-limit countersA shared storeTen instances × local limit of 100 = an actual limit of 1,000
Long-lived connectionsCan't be externalised — see below—

:::key Long-lived connections: the crux of every real-time design

:::

The test to run on every box you draw: if I kill this instance mid-request, what is lost? The answer should be "one request." Anything more is state you haven't externalised yet.

What to leave out

Do not draw: authentication (say "assume an auth service issues tokens" and move on), monitoring and logging (name them in one sentence at the end), CI/CD, or an admin panel.

:::warn Naming a vendor before naming the property

"I'd use Kafka here."
→ says you know a name
"I need a durable append-only log with consumer groups — Kafka, say."
→ says you know what you need, and that the requirement drove the choice

The ordering is the whole signal. Property first, product as shorthand second. :::

How to say it in the interview

"I'll start with the simplest architecture that meets these numbers and then break it deliberately. That way every piece of complexity I add has a reason you can see."

Checklist

Practice this interactively
Share this lessonWhatsAppLinkedInX

Related lessons