Skip to main content
Vertical vs Horizontal Scalinglesson 4 of 4 · 2 min read

Choosing in an Interview

Scale up until you cannot

Scale up until you have a reason not to. A bigger machine is a one-line change and a fleet is a project, and real companies and interviews reward that reasoning equally.

Two reasons force your hand. Redundancy, when downtime stops being acceptable, and the ceiling, when the biggest machine available is no longer enough. Cost sometimes forces it too, since several medium instances often undercut one enormous one.

Answer by tier, not by philosophy

Split your answer by tier rather than picking a philosophy. Your stateless application tier goes horizontal almost immediately, and not for capacity: two small instances behind a balancer buy you deploys and failure tolerance for very little money.

Say that, then say your sessions live in a shared store so the machines stay interchangeable, and you have answered the follow-up before it arrives.

Give your database the opposite instinct. Scale it up, add copies for read traffic, and add caching. Reach for sharding only when sustained writes genuinely exceed what one primary can take, which for a tuned relational database is thousands a second.

Avoid the classic flag. Jumping straight to a sharded database for a system doing 50 writes a second is overengineering, and interviewers watch for it.

Do the arithmetic out loud. If you need 2,000 requests a second and one application server handles 400, that is five servers plus headroom, so call it eight. Numbers like that, even rough ones, separate people who have run systems from people who have read about them.

Close by naming the cost you accepted. Horizontal buys capacity and availability, and the bill is distributed complexity, from managing configuration to the consistency questions the rest of this course exists to answer.

Worked example

Elena gets the classic prompt: design an image sharing service for 5 million daily users. She starts with math: maybe 10 reads per user per day, call it 600 requests per second average and 2,000 at peak. App tier: stateless, 3 instances behind an ALB for availability, autoscaling for spikes. Database: one Postgres primary handles the roughly 60 writes per second easily, so she adds one read replica for the read-heavy feed and stops there. The interviewer pushes: what about 50x growth? Only then does she bring in a CDN for images, more replicas, and sharding by user ID. The feedback afterward says exactly what she wanted: scaled in response to numbers, not by reflex.

Vertical vs Horizontal Scaling: wrapping up

In the real world

  • 01Stack Overflow served its whole Q&A load for years on a scale-up architecture: around nine web servers and two SQL Server boxes with 1.5 TB of RAM each, serving most queries straight from memory.
  • 02WhatsApp tuned FreeBSD and Erlang to hold over 2 million TCP connections on a single server, stretching vertical scaling far enough that a few dozen engineers supported 450 million users at acquisition.
  • 03AWS sells u-24tb1.metal instances with 24 TB of RAM for SAP HANA workloads, which is how high the vertical ceiling goes before you are forced out of it.
  • 04Netflix runs its stateless services in autoscaling groups on AWS and scales fleets down overnight, treating instance counts as a dial that follows the daily traffic curve.
  • 05Pinterest scaled horizontally on deliberately boring technology, sharding MySQL across many commodity instances instead of adopting exotic databases, and wrote publicly about that choice paying off.

Questions people ask

Should a startup go horizontal from day one?

For the app tier, running two small instances behind a managed load balancer is cheap and buys zero-downtime deploys and failure tolerance, so yes if the app is stateless. For the database, no: a single managed primary with backups and maybe one replica is simpler and fast enough until the numbers prove otherwise.

Is vertical scaling a dead end?

The ceiling is higher than most people think; clouds sell machines with terabytes of RAM. The real risks are the single point of failure and being forced into a horizontal migration under pressure when you finally hit the top. Use vertical scaling to buy time, and keep services stateless so the exit stays open.

Why is horizontal scaling harder for databases than for app servers?

App servers hold no data, so adding one is copying a binary. Database nodes must agree on the data, which means replication for reads and sharding for writes, and each brings new failure modes like lag, failover, and cross-shard queries. That is why the standard advice is to scale the app tier out and the database up first.

Quick review

Vertical (scale up):
add CPU cores, RAM, faster NVMe disks. AWS: t3.micro → c5.metal (96 vCPU, 192 GB RAM)
Hard ceiling:
single machine has physical limits. Also single point of failure
Horizontal (scale out):
add commodity servers behind a load balancer. Virtually unlimited
Requires stateless services:
store sessions in Redis/DB, any node must serve any request
Database horizontal scaling is harder:
read replicas for reads, sharding for writes
Auto-scaling:
cloud groups can scale in/out automatically based on CPU/memory/custom metrics
the trade-off

Horizontal adds operational complexity: distributed config, data consistency, network overhead.

in the room

Start vertical. Simpler, cheaper for early stage. Go horizontal when you need redundancy or hit machine ceiling.