Interview's MateSystem Design
Interview's Mate

System Design

Architecture & trade-offs

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
All topics/Scalability
FUNDAMENTALS & NETWORKING · SUBTOPIC

Auto-Scaling & Read/Write Split

Automatically match server count to live traffic while separating heavy reads from writes.

IntermediatePart of Scalability
Practice in AI HLD
Subtopics in Scalability (4)
OverviewVertical ScalingHorizontal ScalingStateless TiersAuto-Scaling & R/W Split

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.

Loading interactive diagram
Loading interactive exercise

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

Quick check

Loading quiz
Previous subtopic
Stateless Architecture
Back to overview
Full Scalability Lesson