Free — no signup required

Introduction: Why "Not Only SQL"?

3 min read

The Relational Hammer

Think of a relational database like a highly organized filing cabinet with strict rules: every folder must have the same labeled tabs, every document must fit a predefined form, and to find related information you must physically walk between cabinets and cross-reference index cards. This system works beautifully when your data is predictable and your office has one filing cabinet. It starts to break down when you have ten thousand cabinets, millions of visitors per second, and documents that don't fit any standard form.

For decades, the relational database management system (RDBMS) was the default choice for storing application data. It excels at structured data, complex multi-table queries, and enforcing transaction integrity through ACID guarantees — Atomicity (all-or-nothing transactions), Consistency (data always valid), Isolation (concurrent transactions don't interfere), and Durability (committed data survives crashes). These properties made RDBMS the backbone of banking, e-commerce, and enterprise software.

The rise of the internet shattered two assumptions that RDBMS were built on. First, scale: websites went from thousands to billions of users, and RDBMS are designed to scale vertically (buy a bigger server) rather than horizontally (add more servers). Horizontal scaling in RDBMS requires complex sharding strategies that are difficult to operate. Second, data shape: social media posts, IoT sensor readings, user profiles with optional fields, and event logs don't fit neatly into rigid table schemas. Running ALTER TABLE on a billion-row table to add a new column can take hours and lock the table.

The NoSQL Explosion

NoSQL — commonly interpreted as "Not Only SQL" — is an umbrella term for a diverse family of databases designed to address these specific problems. They deliberately trade away some RDBMS guarantees (particularly strong immediate consistency and the ability to do arbitrary cross-table joins) in exchange for horizontal scalability, high throughput, and schema flexibility. The trade-off is not a bug; it is the design.

There is no single "NoSQL database." There are four main categories, each optimized for a fundamentally different data model and access pattern:

Category Data Model Primary Strength Representative Systems
Key-Value Store Key → Blob Ultra-low latency lookups Redis, DynamoDB
Document Database Key → JSON/BSON document Schema flexibility, nested queries MongoDB, Couchbase
Wide-Column Store Row Key → Column families Massive write throughput at scale Cassandra, ScyllaDB
Graph Database Nodes + Edges Traversing highly connected data Neo4j, Amazon Neptune

Understanding these categories — and when to reach for each — is a core competency for any Database Reliability Engineer (DBRE) or platform engineer.

Interview Tip

Interviewers frequently ask: "What's the difference between NoSQL and SQL, and when would you choose one over the other?" The trap is treating this as a binary choice. The correct answer acknowledges that most production systems use both: an RDBMS for transactional data requiring ACID guarantees (orders, payments, user accounts) and one or more NoSQL stores for specific high-scale workloads (caching, event streams, recommendations). Saying "NoSQL is better" or "SQL is better" signals inexperience.

Key Point: NoSQL databases are specialized tools, not universal replacements for RDBMS. Choosing the wrong category for your workload — for example, using a key-value store for highly relational data — creates technical debt that is expensive to unwind. The decision must be driven by your data model and access patterns, not by what is trendy.

This is one of 18 chapters

Every chapter is free — Kubernetes, Terraform, SRE, distributed systems, and more — with fast daily review built in.

Sign up free