Definition
Relational databases organize data into tables with rows and columns, enforcing relationships through foreign keys and providing ACID guarantees (Atomicity, Consistency, Isolation, Durability). NoSQL databases use flexible data models (key-value, document, wide-column, graph) optimized for horizontal scaling and predictable latency.
The Relational Approach
Relational databases excel at correctness and complex queries. Data is normalized (stored once and linked via foreign keys), requiring joins to combine data from multiple tables. The database optimizer handles query execution efficiently. A single node handles 10K-50K transactions per second with sub-millisecond latency.
The NoSQL Approach
NoSQL optimizes for horizontal scale by removing cross-entity joins. Data is denormalized (duplicated and pre-combined) so each query reads from one location. A partition key determines where data lives across machines. You must know access patterns upfront because the partition key choice determines whether operations stay local and fast or become slow scatter-gather queries (hitting many machines).
The Fundamental Trade-off
Relational lets you ask unanticipated questions at the cost of scaling complexity. NoSQL requires upfront design for known access patterns but scales horizontally. Choose relational for unpredictable queries or complex multi-table operations. Choose NoSQL when you know access patterns and need to scale beyond a single machine.
✓Relational databases normalize data into tables with foreign keys, enabling flexible ad-hoc queries at the cost of join complexity
✓NoSQL denormalizes data around access patterns, trading query flexibility for predictable latency and horizontal scale
✓A single relational node handles 10,000-50,000 TPS; NoSQL clusters scale to millions of operations per second across thousands of nodes
✓The choice hinges on whether you know access patterns upfront (NoSQL) or need query flexibility (relational)
1When asked about database choice, start by asking: Do we know all access patterns upfront? If yes, NoSQL may scale better. If no, relational provides flexibility.
2Explain the partition key concept clearly: its the field that determines which machine holds the data, so choosing poorly means expensive scatter-gather queries
3Mention the concrete throughput numbers to show depth: single relational node handles 10K-50K TPS, while NoSQL clusters scale to millions