Level 1 · TinyURL
CLIENT–SERVER

Stage 1 · Client–Server · APIs · Databases

TinyURL

A founder needs a URL shortener. Light traffic, simple job: take a long URL, hand back a short one. Wire up the basics and make it work.

Requirements

Functional

  • ·User submits a long URL and gets back a short one
  • ·User visits a short link and is redirected to the original URL

Non-functional

  • ·~2 requests/sec average
  • ·p99 latency ≤ 300ms
  • ·99% availability

Constraints

  • ·Budget: $6/hr or less
  • ·90% of traffic is reads (resolving links), not writes (creating them)

Out of scope

  • ·Custom aliases
  • ·Link expiration
  • ·Click analytics

TrafficRequests per second — the rate of incoming traffic this level throws at your system.

~2 r/s · read-heavy
90% reads · 10% writesWhat fraction of requests are reads (fetches) vs writes (updates) — this decides which components sit on the hot path.

Win conditions

  • p99 latency99% of requests finish at or under this time — a stricter tail-latency bar than p95 that catches worst-case slowness.≤ 300ms
  • availabilityThe share of legitimate requests that succeeded, out of everything sent your way. 99% still means 1 in 100 users saw an error.≥ 99%
  • throughputHow many requests per second your system actually completed — not requested, completed.≥ 1.5 r/s
  • error rateThe share of requests that failed outright: timeouts, drops, or capacity overload.≤ 5%
  • costWhat your architecture costs to run per hour, based on the instances and components you've wired up.≤ $6/hr
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

Drag components from the right → connect their handles → Run.

Drag onto canvas

Components

Client

ClientWhere traffic originates.

Compute

API GatewayFront door — the app tier requests pass through.
500 r/s · 20ms · $2/hr
Backend
350 r/s · 25ms · $2/hr
Lvl 7

Storage

SQL DatabaseRelational store. Durable, but the lowest throughput.
200 r/s · 50ms · $3/hr
NoSQL DB
600 r/s · 30ms · $4/hr
Lvl 3
Redis Cache
5000 r/s · 3ms · $2/hr
Lvl 2
Read Replica
200 r/s · 55ms · $3/hr
Lvl 12
DB Standby
200 r/s · 50ms · $3/hr
Lvl 13

Networking

CDN
50000 r/s · 5ms · $1/hr
Lvl 8
Load Balancer
10000 r/s · 2ms · $2/hr
Lvl 9
Reverse Proxy
8000 r/s · 3ms · $1/hr
Lvl 9

Messaging

Queue
8000 r/s · 8ms · $1/hr
Lvl 6

Security

WAF
20000 r/s · 3ms · $1/hr
Lvl 14
Rate Limiter
20000 r/s · 1ms · $1/hr
Lvl 14