Client
Every design starts and ends with a client: the program that sends the first request and waits for the last byte of the answer. In the playground, client nodes are where traffic is born β the load profile (smoke, load, stress, spike, soak, breakpoint, chaos) decides how many requests per second leave them. In BoxOffice, the clients are the fans' browsers and the mobile app: on a normal day they browse the catalog; at 10:00 on a flash-sale day, 2 M of them press "Buy" in the same minute.
Thinking about the client is not a formality. Where the client is (latency to your edge), what it can do (cache, retry, hold a connection open) and how it behaves under failure (does it retry immediately? does the user hammer F5?) shapes the whole design behind it.
| Component | One-liner | Playground id |
|---|---|---|
| Client | A browser or any program calling your API over the internet | client |
| Mobile | A native app on a phone: flaky networks, offline mode, push notifications, slow release cycle | mobile |
flowchart LR
B[Client<br/>browser / SDK] --> DNS
M[Mobile<br/>iOS / Android] --> DNS
DNS --> CDN
CDN --> LB[Load Balancer]
LB --> APP[App Server] Client
What it is. The generic client: a web browser, a command-line tool, another company's backend or a load-testing tool such as k6. It opens connections (TCP + TLS, or QUIC), sends HTTP requests and waits for responses. It sits outside your control β you cannot patch it, you cannot trust it, and it may be on the other side of the planet.
When to use.
- As the entry point of every playground design: the client node is the workload (requests per second, read/write mix, key popularity).
- To reason about the user-perceived latency: the number that matters is measured at the client, including DNS, TLS handshakes and the round trips to your edge.
- To decide what can be pushed to the client: static assets cached by the browser (
Cache-Control), client-side rendering, idempotency keys generated by the client, exponential backoff in the SDK.
When not to (or watch out).
- Never put business rules or secrets that need to be trusted in the client: prices, seat availability and authorization must be validated on the server.
- Do not assume clients behave: a "Buy" button without debounce, a retry loop without backoff or a scraper bot can multiply your load.
- Do not size the system from the average client; size it from the peak (flash sale) and the worst network (mobile 3G in a stadium).
Key numbers.
| Metric | Typical value | Note |
|---|---|---|
| Round trip SΓ£o Paulo β US East | β 110β130 ms | Speed of light in fiber plus routing; a TLS 1.3 handshake costs one extra round trip |
| Round trip within the same city / to a nearby CDN edge | β 5β20 ms | Why CDNs and edge termination matter |
| Browser parallel connections per host (HTTP/1.1) | 6 | HTTP/2 and HTTP/3 multiplex many requests on one connection |
| Page load the user perceives as "instant" | β 100 ms | Classic usability guideline (Nielsen); β 1 s keeps the flow of thought |
| Flash-sale peak (BoxOffice) | 2 M fans in β 1 min β 33 k new sessions/s | β illustrative assumption used across the course |
Failure modes.
- Retry storms β clients (or users pressing F5) retry immediately after errors and multiply the load during an outage β exponential backoff with jitter in the SDK,
Retry-Afterheaders, a waiting room. - Thundering herd at a fixed time β every client wakes up at 10:00:00 β randomized start, queue-based admission (waiting room), pre-warmed caches.
- Duplicate submissions β double click or timeout + retry creates two orders β idempotency keys generated by the client and deduplicated by the server.
- Stale client caches β the browser keeps an old JavaScript bundle β content-hashed file names, short TTL on the HTML.
- Malicious clients β bots, credential stuffing, scalpers β WAF, rate limiting, CAPTCHA/proof of work, authentication.
In the playground. The client node is a traffic source, not a server: it has no capacity. Arrivals per tick follow a Poisson process whose rate Ξ»(t) comes from the load profile and the target RPS in the toolbar. Its main parameters are readRatio (fraction of reads; the toolbar default is 0.9), zipfS (key popularity skew, default 0.8, used by caches and partitions to create hot keys), botShare (extra bot traffic, default 0) and timeoutMs (the user's patience, default 30 s). The latency percentiles and error rate shown in the metrics panel are measured from the client's point of view. Every scenario starts here; good first ones: monolith, scale-out, flash-sale.
Real products.
- AWS SDKs β official client libraries with built-in retries, exponential backoff and jitter.
- CloudWatch Synthetics β scripted "canary" clients that probe your endpoints from AWS regions.
- Google Cloud client libraries β official SDKs with configurable retry and timeout policies.
- Cloud Monitoring uptime checks β synthetic clients probing HTTP endpoints from several locations.
- Azure SDKs β official client libraries with retry policies.
- Azure Load Testing β managed service that runs JMeter/Locust clients at scale.
- k6 β scriptable load-testing client (JavaScript), used in the course labs.
- curl / HTTPie β command-line HTTP clients for quick manual tests.
- Locust, Gatling, JMeter β other load-generating clients.
In the interview
Start every design by naming the clients and where they are: "web and mobile clients in Brazil, peak 33 k sessions/s at the on-sale moment". Then say what the client does to help you β caching static content, sending an idempotency key, backing off on 429/503 β and what you never trust it with (prices, authorization).
Learn more: Intro βΊ Requirements Β· Estimation βΊ Numbers Β· Edge βΊ Protocols Β· Performance βΊ Load testing Β· Hands-on 2
Mobile
What it is. A native application (iOS, Android) or a mobile web app on a phone. It is a client with extra constraints: the network changes all the time (Wi-Fi β 4G β no signal in the stadium tunnel), the battery is precious, the app version in users' hands may be months old, and the operating system can kill it at any moment. In exchange it can store data locally, work offline and receive push notifications.
When to use.
- When the product needs push notifications (BoxOffice: "your tickets are ready", "the gates open in 1 hour").
- When the experience must survive bad networks: tickets stored on the device and shown offline at the gate (QR code).
- To model a second traffic source with a different mix: mobile clients usually make more, smaller requests and reconnect often.
When not to (or watch out).
- Old app versions live for a long time: never break an API used by a shipped app; version the API and keep backward compatibility.
- Do not chat with the backend: each request on a mobile network costs latency and battery β batch calls, use a BFF (Backend for Frontend) that returns exactly what one screen needs.
- Do not ship secrets inside the app binary (API keys can be extracted); use OAuth 2.1 with PKCE (Proof Key for Code Exchange).
Key numbers.
| Metric | Typical value | Note |
|---|---|---|
| Round trip on 4G | β 30β100 ms | Varies a lot with signal and operator |
| Round trip on 3G / congested cell | β 100β500 ms | A stadium full of phones is a congested cell |
| Round trip on 5G | β 10β30 ms | Best case; coverage is uneven |
| Push notification delivery (APNs/FCM) | usually seconds, best effort | No delivery guarantee; do not use push as the only channel for critical information |
| Share of old app versions in use | can stay above 10% for months | β illustrative; depends on forced-update policy |
Failure modes.
- Connection drops mid-request β the app does not know if the purchase succeeded β idempotency key + a status endpoint to query ("did order X go through?").
- Reconnect storms β after a network or backend outage, millions of apps reconnect at once β randomized reconnect delay with exponential backoff and jitter.
- API breaking change β an old app version crashes β API versioning, contract tests, minimum supported version.
- Clock skew on the device β the phone's clock is wrong, tokens look expired β validate time on the server, use server timestamps.
- Push provider failure or throttling β treat push as best effort, keep the information available in the app and by e-mail.
In the playground. mobile is a traffic source just like client, with the same parameters (readRatio, zipfS, botShare) but a shorter default timeoutMs (15 s instead of 30 s), driven by the same load profile. Use it next to a client node to model two populations with different read/write mixes or to route them through different paths (for example, mobile through an API Gateway acting as a BFF). Scenarios: chat, ride-sharing, notification-system.
Real products.
- AWS Amplify β framework and hosting for web and mobile front ends with auth and APIs.
- Amazon SNS mobile push β sends push notifications through APNs and FCM.
- AWS Device Farm β tests apps on real phones.
- Firebase β mobile platform (Google): Cloud Messaging (FCM) for push, Crashlytics, Remote Config, App Distribution.
- Firebase Test Lab β runs app tests on real and virtual devices.
- Azure Notification Hubs β push notifications to iOS, Android and Windows at scale.
- Azure App Service β hosts mobile backends.
- React Native, Flutter β cross-platform mobile frameworks.
- OkHttp (Android), URLSession (iOS) β HTTP clients with connection pooling and HTTP/2.
- ntfy / Gotify β self-hosted push notification servers.
In the interview
"Mobile clients are on unreliable networks and run old versions, so I keep the API backward compatible, make every write idempotent so the app can safely retry, and use push only as a best-effort nudge β the source of truth is always the server."
Learn more: Edge βΊ Protocols Β· Compute βΊ API styles Β· Network & security βΊ Identity Β· Case study: chat Β· Case study: notification system