§01Why separate the database
Servers are stateless and disposable — you can run many copies of the same server behind a load balancer. Databases are stateful: they hold the canonical record of what your system knows.
A typical request now flows: client → server → database → server → client. The server is the orchestrator; the database answers "what data?".
§02Capacity and latency
⚑ NOTE
Two numbers to track
Capacity = how many requests can be in flight at once. Latency = how long each one takes. When in-flight requests exceed capacity, new arrivals get dropped.
- Server capacity ≈ 80 concurrent.
- Database capacity ≈ 120 concurrent (but each request takes longer).
- If your offered load × latency exceeds capacity, you have a bottleneck.
⚑ CHEATSHEET · QUICK REFERENCE
- Servers compute; databases persist.
- Watch for a node where peak in-flight = capacity AND new arrivals are dropping.
▸ THE EXERCISE
Servers are stateless. Add a database behind your server so writes survive a restart. The client should still only talk to the server.