SystemKit

Scale to a Million Users

Grow one system step by step: split tiers, add load balancing, replication, caching, a CDN, queues, and sharding. Each step answers a specific pressure and brings a new cost, and the chapter ends with a full design of your own.

Lessons

  1. 01Begin with one serverFollow a request before adding any infrastructure.
  2. 02Separate web and dataGive application code and stored data room to grow independently.
  3. 03Grow the web tierKnow when to strengthen one machine and when to add more.
  4. 04Protect the databaseReplicas add read capacity and provide a path through database failure.
  5. 05Cache repeated workKeep frequently requested results close to the web tier.
  6. 06Deliver assets near usersUse a CDN for reusable static files across distances.
  7. 07Keep web servers replaceableAny healthy web server should be able to serve the next request.
  8. 08Serve more than one regionRoute users near a healthy data center and keep required data available there.
  9. 09Move slow work off the requestA queue lets web requests and background workers move at different speeds.
  10. 10See and operate the systemMeasure the bottleneck before changing the architecture.
  11. 11Partition a growing databaseShard only when one database cannot reasonably hold or handle the workload.
  12. 12Scale in response to evidenceEach technique answers a different pressure on the system.

Practice this chapter

  1. LabWhat happens to your database when the cache disappears?Set the request rate and hit rate, take the cache away, and predict whether the database can absorb the load.
  2. TaskDesign a photo-sharing serviceBring the chapter together in one design, then revisit it when the requirements change.