# Messaging — one-pager

BayLearn · System Design Interview Sprint

**Today’s idea:** To-do inbox = one job. Group announcement = many listeners. Scrollable history = catch up / replay. Size in-flight as QPS × time. Assume twice. Name the key.

| Word | Plain meaning |
|------|----------------|
| To-do inbox | Queue. Workers take turns |
| Group announcement | Pub/sub. Everyone gets the same update |
| Scrollable history | Stream. Order per key. Replay is a project |
| User waits | Live request. No buffer |
| Background job | Async. User can leave |
| In-flight | Peak QPS × time. ClinicDocs 19 × 8s ≈ **152** |
| 202 | We got it, not we finished |
| At-least-once | Default. Same job can show up twice |
| Unique key | Same order id / receipt. PayRail 1,200/s × 2% ≈ **24** replays/s |
| Claimed time | Visibility > job. 8s scan → 30–60s |
| Failed-jobs folder | DLQ. 3–5 tries, then park. Alarm |
| Age | Oldest job. Depth lies |
| Ledger then inbox | Save official record, then enqueue |

**What to say:** I picked this because of this number (or this rule). What I give up is this.

## Six rows

| Product | Shape | In-flight | Twice | Don’t do this |
|---------|-------|-----------|-------|----------------|
| Linkly | User waits; no broker | 23/s × 2 ms < 1 | N/A on 302 | Kafka on create or GET |
| PulseFeed | Announce; history if replay | Not 12M inline | Post id | Fan-out-on-write 12M homes |
| RideHail | Overwrite ping | 75k last-point | Last write wins | 1.3 TB/day ping history |
| PayRail | User waits $49; inbox mail | Mail 1,200 × 0.2s ≈ 240 | Idempotency-Key | SMTP on authorize |
| ClinicDocs | To-do inbox scan | 19 × 8s ≈ 152 | fileId | 8s on HTTP; 15s stall at 90s |
| TicketDrop | Room + inbox confirm | 10:00 burst | Hold / email key | 500k HTTP to seats |

Skip the broker when work is milliseconds. Kafka with no consumer is decoration.

Use this as a pocket card while you practice out loud.
