Auto-Scaling & Read/Write Split
Automatically match server count to live traffic while separating heavy reads from writes.
In plain words
Auto-scaling automatically wakes up extra servers when a crowd arrives and puts them back to sleep at night so you don’t waste money.
Think of it like…
A theme park opens extra ticket booths at 10 AM when lines grow and closes them at 7 PM when it’s quiet.
Theory & how it works
Reactive vs. Predictive Auto-Scaling
Reactive scaling watches metrics like CPU %, memory, or request queue depth and adds servers when thresholds cross (e.g., CPU > 65%). Because VMs take 1–2 minutes to boot, sudden flash spikes can still drop traffic briefly unless you keep some headroom or use fast-starting containers.
Predictive scaling uses daily/weekly patterns (e.g., 8:55 AM market open or 6:00 PM commute) to pre-warm capacity ahead of time.
Read/Write Separation
Because writes require locks and disk durability while reads can tolerate a tiny delay, splitting traffic lets you scale reads cheaply with Redis and read replicas while keeping the primary DB focused strictly on writes.
Key points & practical guide
Summary checklist
- Scale on request latency or queue depth, not just CPU (I/O-bound apps stall with low CPU)
- Keep a warm buffer (~20–30% headroom) for sudden spikes
- Route non-critical reads to replicas; route read-after-write flows to the primary
When to use it
- Predictable day/night traffic curves
- Read-heavy workloads (10:1 or 100:1)
Watch out for
- Cooldown oscillation ("flapping"): scaling up and down every minute
- Replication lag causing a user not to see data they just saved