Lessons › From one user to millions
Your first users
You just launched. About 300 requests per second arrive from users.
Play this levelFree, no account needed. It runs in your browser: build the design, press Run, and watch what breaks.
The lesson
Almost every system is a chain of request → response hops. A user sends a request, a server does some work and answers.
At the start, one server running both your code and your data is enough. Keep it simple until something breaks.
What you have to achieve
300 requests a second at the busiest hour, 10% of them writes.
- No broken or illegal connections
- Use an App Server
- No failed requests
- p99 response time under 200 ms
What you learn
Notice the response time: most of it is the ~60 ms trip across the internet, not your server's work.
Check yourself
Your first design answered in about 70 ms. Following one request shows about 60 ms travelling between the user and your server, and about 10 ms of work inside it. Where did most of the time go?
- The server doing its work
- The trip across the internet
- Reading from the disk
Show the answer
The trip across the internet. The round trip between the user and your data centre is most of it. Your server's own work was a small part. Press Follow a request any time to see each step and its time.
When is one server running both code and data the right design?
- Never, it's always a mistake
- Only for internal tools
- At the start, until something breaks
Show the answer
At the start, until something breaks. Keep it simple while traffic is small. You split things up when a real limit forces you to.