How to Choose a Database (Without Overthinking It)
Relational, document, key-value, search or analytical? A practical way to pick the right one for the job, and when to stop at one.
Database choice attracts more debate than almost any other technical decision, and most of that debate is irrelevant to the project in front of you. Start with the shape of your data and your queries, and the list narrows quickly.
The first question: what are your queries?
Not what your data looks like โ how you will ask for it.
- Do you look things up by one identifier and just fetch them?
- Do you filter and combine records by several conditions?
- Do you need full-text search with ranking?
- Do you need aggregates across enormous volumes for reporting?
Each of those points at a different family of tools. Getting this wrong is far more expensive than picking a slightly slower engine.
The main families
| Family | Best at | Typical choice |
|---|---|---|
| Relational | Structured data, joins, transactions, evolving queries | PostgreSQL or MySQL |
| Document | Flexible nested records fetched as a whole | MongoDB |
| Key-value | Extremely fast lookup by a single key | Redis |
| Search | Ranked full-text search and faceted filtering | Elasticsearch, OpenSearch |
| Analytical | Aggregating large volumes for reporting | ClickHouse, BigQuery |
| Graph | Deep relationship traversal | Neo4j |
Why the relational default is so strong
For most applications, a relational database is the correct answer, and the reasons are practical rather than fashionable:
- Transactions. Multi-step changes either all happen or none do. This prevents whole classes of corruption.
- Constraints. The database itself enforces uniqueness and valid references.
- Joins. You can answer questions you did not anticipate when you designed the schema.
- Maturity. Decades of tooling, backups, monitoring and people who know it.
The common beginner mistake is reaching for an exotic store because it sounds modern, then rebuilding joins, transactions and constraints by hand โ badly.
When to go beyond it
Reach for something else when you have a specific, measurable reason:
- Reads are too slow and you re-read the same record constantly. A cache in front of the database usually solves this, before changing the database itself.
- Your records are genuinely document-shaped and always read as a whole, with no cross-record reporting.
- Search quality is the product. Ranked relevance, synonyms and faceting are a different problem from storage.
- Reporting queries stall the application. Move analytics to a separate analytical store fed by a pipeline.
The habits that matter more than the engine
- Benchmark with your real queries, not with synthetic numbers from a blog post.
- One database is easier to operate than four. Operational complexity is a tax paid forever.
- Indexes are usually the missing piece. A slow query is more often a missing index than a wrong engine.
- Plan backups from day one. An unbacked-up database is a future outage.
- Measure before switching. Migration is expensive; a query plan often is not.
The bottom line
List the queries you will actually run. If they are structured and relational, start there and stay there. Add specialised stores only when a specific, measured problem demands one.