Scalability & Performance
Overview

Scalability & Performance

The ability of a system to handle increased load without degrading performance.

Once you have the building blocks, the next question is: how do you make them handle millions of users? This stage covers the fundamental scaling strategies and the tradeoffs each one carries.


Topics

ChapterWhat It Covers
Horizontal vs VerticalWhen to scale up vs scale out, limits of each
ShardingHash, range, directory-based, geo-based, consistent hashing
PartitioningHorizontal vs vertical partitioning, when it differs from sharding
Database ReplicationSingle-leader, multi-leader, leaderless, sync vs async
Consistent HashingHash ring, virtual nodes, rebalancing
Rate LimitingToken bucket, leaky bucket, sliding window
DenormalizationWhen to break normalization, tradeoffs

The Core Tradeoff

Scaling is never free. Every strategy trades one problem for another:

  • Vertical scaling → cost grows exponentially, hardware ceiling
  • Horizontal scaling → state must be externalized, distributed systems problems
  • Sharding → cross-shard queries become expensive
  • Replication → consistency vs availability tension

Understanding these tradeoffs is what separates a good answer from a great one in interviews.