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