Module 4 9 lessons 114 min

When one server isn't enough

The database keeps up, but the dinner rush keeps growing and the one server sits at 95% CPU. Buy a bigger one, then outgrow it - and fix everything that breaks the moment there are two servers.

In this module

8 Read · 1 Lab

  1. 4.1Vertical scalingOur load test found where one server breaks. The first fix is a bigger machine - and it has a ceiling.Read12 min
  2. 4.2Horizontal scalingMore machines instead of a bigger one: no ceiling, and no single server to lose - but now there are two.Read12 min
  3. 4.3Load balancersA reverse proxy with more than one server behind it: how it picks a server, what happens when one dies - and why the balancer can't be a single point of failure.Read12 min
  4. 4.4Stateless serversWhy a login breaks on server two, and where sessions, cache and photos go instead.Read15 min
  5. 4.5Connection poolingEvery server opens its own database connections. Add servers and you hit the database's limit while it's barely busy - pools and database proxies.Read10 min
  6. 4.6Object storage: where the photos goDish photos don't belong on a server's disk or in the database. A bucket holds them, and the app uploads straight to it.Read10 min
  7. 4.7CDN: a cache near the userServe menu photos from close to the customer, not from your servers.Read10 min
  8. 4.8Proof: two servers behind a load balancerThe load test that broke one server, run again against two. What doubled, and what didn't.Read8 min
  9. 4.9Lab: Does the clinic need a second server?The Monday 9am rush, a $50 budget, and the numbers that decide.Lab25 min
Then · Module 5When one database isn't enough