Module 95: Scaling
Goal: make a system handle much more traffic without slowing down or costing a fortune: measure where the limits are, spread load across servers, cache wisely, scale the database, and push work out of the request path.
You'll need: the booking platform (or your CRM) running with Docker Compose, a load-testing tool such as k6, and the monitoring you set up in Module 72.
Lessons
- 1Measuring performance15–25 minutes✓
- 2Load balancing15–25 minutes✓
- 3Caching15–25 minutes✓
- 4Scaling the database15–25 minutes✓
- 5Asynchronous work and scaling costs15–25 minutes✓
🛠️Module practice: Project C, part 1, a performance plan
- k6 load, stress and soak tests with thresholds, run on staging, with the bottleneck found and fixed.
- Several stateless API copies behind a load balancer with health checks, tested by stopping one.
- Redis caching for read-heavy data with invalidation, and no caching on the booking path.
- Database scaling steps measured on realistic data volumes (indexes, pooling, replica routing).
- Slow work moved to separately scaled workers, with cost per thousand bookings now and at 10x.
✅Module check
Explain in a few sentences, in your own words:
How do you scale a system to handle much more traffic?
Show a good answer
A good answer mentions: measuring first (percentile latency, throughput, errors, saturation) with load, stress and soak tests to find the bottleneck, fixing one at a time; stateless app copies behind health-checked load balancers with autoscaling; caching at the browser, CDN, application and database layers with expiry and invalidation, never for data that must be exact like slot reservation; scaling the database in order (queries and indexes, pooling, bigger server, caching, read replicas with lag handled, partitioning, archiving, sharding rarely); and keeping the request path short with background workers scaled separately, while tracking cost per unit and avoiding premature scaling.
📝Module quiz
10 questions · 10 marks each · 100 marks in all · pass mark 70% · retry as often as you like ·
