Bugpit

Lessons › From one user to millions

Your first users

You just launched. About 300 requests per second arrive from users.

Play this level

Free, 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.

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?

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?

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.

Try it yourself

More in From one user to millions

Separate the database →