SQLNoSQLACIDBASEDatabase SelectionConsistencySystem Design

Choosing a Database

There is no 'best' database — only the right one for your use case. Learn SQL vs NoSQL trade-offs, ACID vs BASE consistency models, and a decision framework for real-world systems.

25 min read9 sections
01

The Big Picture — Why Database Choice Matters

Choosing a database is one of the most consequential decisions in system design. It affects your data model, query patterns, scaling strategy, , and operational complexity for years. Changing databases later is like swapping the engine of a car while driving — possible, but painful and expensive.

🚗

The Vehicle Analogy

There's no 'best vehicle' — it depends on the terrain. A sedan (SQL) is reliable, structured, and predictable. It follows well-paved roads (schemas, joins, transactions) and gets you there safely. A pickup truck (document DB) handles rough terrain — flexible cargo, no fixed structure, great for varied loads. A motorcycle (key-value store) is blazing fast for simple trips — one key, one value, no overhead. A bus (wide-column DB) carries massive loads across long distances — built for scale, not for agility. You wouldn't take a motorcycle to move furniture, and you wouldn't take a bus to the corner store. The same logic applies to databases.

The biggest mistake engineers make is choosing a database based on hype or familiarity instead of requirements. "We use MongoDB because it's popular" is not a design decision — it's a default. Real design means analyzing your data patterns, consistency needs, and scale requirements, then picking the tool that fits.

🔥 Key Insight

There is no "best" database. PostgreSQL, MongoDB, Redis, Cassandra, DynamoDB — each excels at specific workloads and struggles at others. The skill is matching the database to the problem, not the other way around.

1 / 9