Replication: Copies all data to multiple servers.
- Scales reads (read from any replica)
- Doesn't scale writes (all writes go to primary)
- Doesn't help with data volume
Sharding: Splits data across servers.
- Scales reads AND writes
- Handles data growth
- Adds complexity
Decision framework:
- Read bottleneck only → Add replicas
- Write bottleneck → Add shards
- Storage bottleneck → Add shards
- Both read and write issues → Add shards with replicas per shard
Most large systems use both: sharded database where each shard has replicas.