🗄️ Database Design / Normalization
Intermediate
What is the difference between horizontal and vertical scaling of databases?
Answer
Vertical scaling (scale up) adds more resources to the existing database server — more CPU, RAM, faster storage. Simple to implement (no code changes needed), but has physical limits and creates a single point of failure. Works well for RDBMS since they are designed for single-server deployment. Horizontal scaling (scale out) adds more servers to distribute the load. For databases, this means replication (read scaling with replicas) or sharding (distributing rows across multiple servers). Horizontal scaling is complex — cross-shard queries, distributed transactions, and data consistency become challenges. NoSQL databases like Cassandra are designed for horizontal scaling from the ground up.
More Database Design / Normalization Questions
View all →- Intermediate What are database anomalies and how does normalization prevent them?
- Intermediate What is denormalization and when is it used?
- Intermediate What are isolation levels in database transactions?
- Intermediate What are dirty reads, non-repeatable reads, and phantom reads?
- Intermediate What is query optimization and what is a query execution plan?