2026-11-01
·
dx - 7 - How to choose a database?
Originally published at hyper.dev, 2021-09-12 (archive).
Every database is a set of trade-offs. Before picking one, answer
these questions to find out which trade-offs you can afford.
Search quality
- How accurate should the search hits be (cf. Precision and
Recall)?
- Do you need “best ranked results”, “some result”, or “all the
matching documents”?
Speed and workload
- How fast should a query be: sub-second, or a second / minute / hour
/ day?
- What is the expected workload regarding reads and writes?
- I guess consistency is a must have, but how fast do you need writes
to be available for read?
Query shape
- Do you need deep traversal kind of queries?
- Do you need textual search?
- Do you need multiple criteria lookup with exact match, sorting, and
possibly facets?
Operations
- How do you migrate: schema changes, data moves, and upgrades of the
database itself? Can it be done online, without downtime?
- How do you scale up, and scale down? Is it a matter of adding and
removing nodes, or of restarting a bigger machine?
- How do you back up, and how long does a restore take? Have you
tested it?
- What happens when a machine dies: replication, failover, and how
much data can you afford to lose?
- How do you monitor it, and debug a slow query in production?
- Who is on call, and does your team know how to run it? What does it
cost to run, and how hard is it to leave (lock-in, export format)?