The Client — Where Every Story Begins
Follow one request through the system — each component exists because the previous layer hit a limit.
The Client — Where Every Story Begins
Picture Priya in Mumbai opening your app at 9 PM. She doesn't care about servers or shards — she just wants her feed to load. But her tap is where your entire system design starts.
The client is anything on the user's side: a web browser, iOS app, Android app, or even a smart TV. It renders UI, captures input, and makes HTTP requests on behalf of the user. It does not run your business logic — it asks someone else to.
- 1. Store secrets safely — Anything in a mobile app can be reverse-engineered. Never trust the client for auth decisions.
- 2. Handle scale — A million users means a million clients — you can't coordinate them from one place.
- 3. Guarantee consistency — Networks drop. Apps get killed. The client might retry, duplicate, or lose requests.
When Priya taps "Buy", her app sends an HTTP request: a method (POST), a URL (/api/v1/orders), headers (auth token, content-type), and a body (product ID, quantity). That's it. The client's job is to format this correctly and render whatever comes back — JSON, HTML, or an error message.
Web Browser
fetch() or XHR. Caches static assets locally. Single origin policy limits which APIs it can call unless CORS is configured.