Bugpit

Lessons › From one user to millions

Ready for launch

The design holds up at 5,000 req/s. But nobody can reach it by name, nothing blocks attacks, the passwords are in the code, and if it breaks at 3 a.m. you'd hear about it from your users.

Play this level

Free with an account. It runs in your browser: build the design, press Run, and watch what breaks.

The lesson

None of these parts make your app faster. They decide how fast you find out something's wrong, and how fast you fix it.

DNS turns your name into an address, and a firewall drops bad traffic before it costs you anything. Both are cheap compared to what they prevent.

Metrics tell you that something is wrong. Logs tell you what happened. Traces show which service made one request slow. You want all three, and they're sent aside, so users never wait for them.

Secrets belong in a secrets store, not in git. Coordination such as etcd or ZooKeeper is how machines agree on a leader: run 3 or 5, and keep it small.

What you have to achieve

5,000 requests a second at the busiest hour, 5% of them writes.

What you learn

Open "Where the money goes": the firewall, logs and traces now cost more than all your machines. That's a common surprise in real companies, and the reason teams log less at high traffic and keep a small sample of traces.

Check yourself

Metrics, logs and traces: which shows which service made one request slow?

Show the answer

Traces. Metrics say something is wrong, logs say what happened, and traces follow one request across services.

Where do passwords and API keys belong?

Show the answer

In a secrets store. Anything in git can leak. A secrets store keeps them out of the code and lets you rotate them.

Try it yourself

More in From one user to millions

← People you may know Go worldwide →