Every new project reaches the same moment early on: someone opens a doc titled "Tech Stack" and types Database: followed by a blank.
It is tempting to fill it with whatever the team used last time, or whatever was trending on Hacker News that week. But the database is one of the few decisions in a system that is genuinely hard to undo. Frameworks, UI libraries, even languages can be swapped piece by piece. Your data, and every query written against it, is far harder to move.
The problem is not a lack of options. It's that there are too many, and each one is excellent at something different.
The Database Landscape in One Pass
At the highest level, databases split into two families.
Relational (SQL)
PostgreSQL, MySQL, SQL Server, Oracle.
Data lives in tables with a fixed schema. Rows relate to each other through foreign keys, and you combine them at query time with joins. You get ACID transactions, strong consistency, and a query language (SQL) that can answer questions you didn't plan for.
This is the default for structured data, and for good reason: it has been battle-tested for decades.
Non-Relational (NoSQL)
"NoSQL" isn't one thing. It's a bucket of very different designs, each built to drop some relational guarantee in exchange for something else.
Document stores – MongoDB, Firestore. Data is stored as JSON-like documents. Great when the schema is flexible or evolves often, and when you usually read one entity with its nested data in one go.
Wide-column stores – Cassandra, ScyllaDB, HBase. Built for massive write throughput spread across many nodes. You design tables around the queries you'll run, not around the entities.
Key-value stores – Redis, DynamoDB, Memcached. Look up a value by its key, extremely fast. Redis in particular is the go-to for caching, sessions, rate limiting, and leaderboards.
Graph databases – Neo4j, Amazon Neptune. Data is stored as nodes and edges. Built for complex relationships and graph traversals, like "friends of friends who also liked this product."
Offline-first databases – CouchDB (with PouchDB on the client). Designed to work on a device with no network and sync when it comes back online.
Specialised Databases
Then there are databases built for one specific type of workload:
Time-series databases – InfluxDB, TimescaleDB, Prometheus. Optimised for data where every record has a timestamp: metrics, IoT sensor readings, stock ticks.
Vector databases – Pinecone, Weaviate, Milvus, pgvector. Store embeddings and find the "nearest" ones by similarity. These power semantic search and RAG systems.
Search engines – Elasticsearch, OpenSearch. Built for full-text search, relevance ranking, and log analytics. Elasticsearch also supports vector search now.
So the real question is not "SQL or NoSQL?" It's "what does my workload actually need?" And the way to answer that is to ask the right questions before writing the first migration.
1. What Does Your Data Look Like?
Start with the data model. This question alone often narrows the list to two or three options.
Is it structured? Users, orders, invoices, and payments have a clear, stable shape. A relational database fits naturally.
Is it semi-structured or changing often? Product catalogs where a shoe has size and a laptop has ram, CMS content, or user-generated forms. A document store saves you from endless ALTER TABLE calls.
Are relationships the main point? If your core queries are "who is connected to whom" and "how many hops away," a graph database will beat a pile of recursive SQL joins.
Is it time-indexed? If almost every query includes a time range ("CPU usage over the last 24 hours"), a time-series database handles retention, downsampling, and range scans far better.
Is it unstructured? Images, PDFs, and videos belong in object storage (S3), with only their metadata in a database. If you need to search them by meaning, add embeddings in a vector store.
2. How Will You Read and Write It?
This one is often skipped, and it matters as much as the data model. Access patterns decide whether a database will feel fast or painful.
Do you know your queries upfront? Cassandra and DynamoDB are fast because you model tables around specific queries. If a new product requirement needs a query you didn't plan for, you may have to create a new table and backfill it.
Will people ask ad-hoc questions? Analysts, admin dashboards, and "can you pull a report of..." requests are where SQL shines. Any column can be filtered, joined, or grouped without redesigning storage.
What's the read-to-write ratio? A chat app or IoT pipeline is write-heavy. An e-commerce catalog is read-heavy. These want very different storage engines. (If both sides are extreme, that's when patterns like CQRS come in.)
Do you need multi-record transactions? Moving money between two accounts must either fully happen or not happen at all. Relational databases give you this out of the box. Many NoSQL databases support it only in limited form, or not at all.
3. How Much Scale, Really?
Be honest here. Most applications never reach the scale that would justify an exotic database.
How many rows? Under 1 million rows, almost any database works. Even hundreds of millions of rows are routine for a well-indexed PostgreSQL.
How many concurrent users? A few thousand concurrent users is comfortable for a single relational database with a connection pool and a cache in front.
How fast is the data growing? 10 GB that grows to 12 GB next year is a very different problem from 10 GB a day.
Do you need to scale writes horizontally? Read scaling is easy with replicas and caching. Write scaling across machines is where relational databases start to need sharding, and where Cassandra-style databases were born.
4. How Consistent Does It Need to Be?
When data is copied across multiple nodes, you have to decide what happens when they briefly disagree. There are three broad models.
Strong consistency – every read sees the latest write. Bank balances, inventory counts, and seat bookings need this. Relational databases on a single primary give it by default.
Eventual consistency – replicas will agree eventually, but a read right after a write may return old data. Fine for likes, view counts, and social feeds, where being a second behind hurts no one.
Tunable consistency – you choose per query. In Cassandra you can read with ONE (fast, possibly stale) or QUORUM (a majority of replicas must agree). DynamoDB lets you request a strongly consistent read when you need it. MongoDB has configurable read and write concerns.
A useful exercise: for each feature, ask "what's the worst thing that happens if the user sees data that's 2 seconds old?" If the answer is "they get charged twice," you need strong consistency there.
5. How Fast Does It Need to Respond?
Latency requirements push you toward certain architectures.
Sub-millisecond reads? That's in-memory territory: Redis, or a cache in front of your main database. (Just be ready for what happens when that cache expires; see Cache Stampede.)
Users spread across the globe? A single database in one region adds 100–300ms for faraway users. You may need read replicas per region, or a globally distributed database like DynamoDB Global Tables, CockroachDB, or Spanner.
Is the p99 what matters? Averages hide pain. A database with great average latency but long garbage-collection pauses can still make 1 in 100 requests feel broken.
Is heavy analytics running next to user traffic? A big reporting query on the same database as your checkout API will slow checkout down. Analytics often belong in a separate warehouse (BigQuery, Snowflake, ClickHouse).
6. Does It Need to Work Offline?
This matters most for mobile and field apps: delivery drivers, health workers, note-taking apps, anything used on a flaky connection.
Does the app need to read and write without a network?
When two devices edit the same record offline, how are conflicts resolved?
CouchDB + PouchDB were designed for exactly this: each device holds a local copy, and replication syncs changes both ways. Firestore has built-in offline persistence for mobile and web clients. Retrofitting offline sync onto a database that wasn't designed for it is one of the hardest problems in app development, so decide early.
7. Who Is Going to Run It?
The best database on paper can be the worst in practice if no one on the team knows how to operate it.
Does the team already know it? Familiarity with indexing, query plans, and failure modes is worth a lot.
Managed or self-hosted? Running a Cassandra or Elasticsearch cluster yourself means handling upgrades, backups, rebalancing, and 3 AM pages. Managed services (RDS, Atlas, DynamoDB) cost more but buy you sleep.
What does it cost at your scale? Some managed databases are cheap when small and very expensive at high throughput. Run the numbers for where you'll be in a year.
Is the ecosystem healthy? ORMs, drivers, migration tools, monitoring, and Stack Overflow answers all matter when something breaks.
The Migration Tax
The reason all these questions matter is simple: switching databases later is very expensive.
A database migration is rarely a weekend job. It usually looks like this:
11. Dual-write App writes to OLD and NEW databases
2 │
3 ▼
4 2. Backfill Copy years of historical data into NEW
5 │
6 ▼
7 3. Verify Compare results; fix data that doesn't match
8 │
9 ▼
10 4. Shadow reads Read from NEW, compare with OLD, log mismatches
11 │
12 ▼
13 5. Cut over Switch reads to NEW, keep OLD as a fallback
14 │
15 ▼
16 6. Decommission Finally turn off OLD (months later)
And along the way:
Every query has to be rewritten, because SQL doesn't translate to Cassandra's query model or to MongoDB's aggregation pipeline.
Assumptions baked into the code break. Code that relied on transactions or joins has to be redesigned, not just ported.
The team runs two databases at once for months, paying for both and on call for both.
Product work slows down, because engineers are moving data instead of shipping features.
This doesn't mean you should never migrate. Sometimes it's the right call. It means the questions above are worth an afternoon of thinking before you choose, because the cost of a wrong answer is paid in months, not hours.
Quick Reference
Structured data, transactions, ad-hoc queries → PostgreSQL, MySQL
Flexible or evolving schema → MongoDB, Firestore
Massive write throughput, known query patterns → Cassandra, ScyllaDB, DynamoDB
Relationship-heavy queries → Neo4j, Neptune
Caching, sessions, sub-millisecond reads → Redis
Metrics and time-stamped events → InfluxDB, TimescaleDB
Semantic search and embeddings → Pinecone, Weaviate, pgvector
Full-text search and logs → Elasticsearch, OpenSearch
Offline-first mobile apps → CouchDB + PouchDB, Firestore
Most real systems end up using more than one of these. A typical stack might use PostgreSQL as the source of truth, Redis for caching, and Elasticsearch for search. That's normal, and it's called polyglot persistence.
Closing Thoughts
Here's the honest truth: nobody knows for sure which database is right.
If they did, we wouldn't keep seeing engineering blogs from the biggest companies in the world explaining why they moved from one database to another:
Discord started on MongoDB, moved to Cassandra as messages grew into the billions, and later moved again to ScyllaDB to fix latency and maintenance problems at trillions of messages.
Netflix moved from Oracle in its own data centers to Cassandra on AWS as it went global.
Uber famously wrote about switching from PostgreSQL to MySQL because of how Postgres handled writes and replication at its scale.
These are teams full of brilliant engineers, and they still changed course. Not because they chose badly at first, but because the product, the scale, and the data changed under them. The database that was right for 1 million messages wasn't right for 1 trillion.
There is no single database that solves every problem. Each one is a set of trade-offs, and the job is to pick the trade-offs you can live with today, while keeping an eye on what might break tomorrow.
So ask the questions. Write down the answers. Pick the simplest thing that fits. And when the answers change, you'll know exactly why it's time to revisit the decision.
Takeaway:There is no "best" database, only the one that best fits your data, your queries, and your team right now.