Relational or non-relational database?
The right choice follows from how your data is shaped and how it will be read and written. Many production systems end up using one of each.
Where do the two models really part ways?
Relational databases store data in tables linked by keys and let you combine them freely with SQL at query time. Non-relational databases store data in a shape built for particular reads, such as a whole document, a value by key or a partition of rows, and usually expect you to design for those reads in advance. Relational systems optimise for flexibility and correctness across records; non-relational systems optimise for a known access pattern and often for spreading data over many machines.
How do they compare point by point?
| Aspect | Relational | Non-relational |
|---|---|---|
| Data shape | Tables, rows, columns, foreign keys | Documents, key-value pairs, wide rows, graphs |
| Schema | Enforced by the database | Mostly enforced by the application |
| Queries | Ad hoc SQL with joins | Designed around known lookups |
| Transactions | Multi-row, multi-table ACID | Often per record, some multi-record |
| Scaling | Up first, replicas for reads, sharding as an add-on | Often out across nodes by design |
| Typical engines | PostgreSQL, MySQL, MariaDB | Redis, Valkey, Cassandra, document stores |
When should relational be the default?
When records reference each other and must stay consistent. Orders, invoices, stock levels, user accounts and permissions all fit tables naturally, and constraints stop impossible states such as an order for a deleted customer. SQL also lets you answer questions nobody planned for, which matters as a business grows. One well-tuned PostgreSQL or MySQL server on a machine with plenty of memory handles far more traffic than most projects ever see, so starting relational rarely needs revisiting.
When does a non-relational store win?
When the access pattern is narrow and extreme. A session store doing two hundred thousand reads a second by key belongs in Redis or Valkey. An append-heavy event stream written from thousands of devices suits Cassandra, which spreads writes evenly across nodes. Product records with wildly different attributes fit a document model. Full-text search with typo tolerance and facets belongs in a search engine. In each case the specialised system is simpler to operate for that job than bending SQL to fit.
Is scaling still a reason to leave SQL?
Less than it used to be. Hardware has outgrown most data sets: a single machine with 48 and fast NVMe, such as ENTERPRISE-a4 2026, runs a relational database serving tens of thousands of transactions per second. Read replicas add read capacity, and extensions such as Citus spread PostgreSQL across nodes. Scaling out by design still matters for very large write volumes spread across regions, where wide-column stores shine.
How does a combined design look?
A relational database as the source of truth, with specialised stores beside it fed from it. A typical web platform keeps orders and accounts in PostgreSQL, caches hot pages and sessions in Valkey, mirrors product data into a search engine for the storefront, and streams events to a time-series store for dashboards. Change data capture or application events keep the copies updated:
# cache-aside read in a shell example: try the cache, fall back to SQL, then fill the cache
v=$(valkey-cli GET product:1842)
[ -n "$v" ] || { v=$(psql -Atc "SELECT row_to_json(p) FROM products p WHERE id=1842" shop);
valkey-cli SET product:1842 "$v" EX 300 >/dev/null; }
echo "$v"
Each copy can be rebuilt from the source of truth, which keeps the system recoverable.
What does each need from the hardware?
Relational databases want memory for the working set and NVMe mirrors for the log. In-memory stores want memory above all. Distributed wide-column clusters want several similar nodes, each with fast local disks. On our catalogue, that maps to a Business line machine for the main SQL database, a memory-rich Essential line model for the cache, and three or more identical machines for a cluster. Our Non-relational database and MySQL articles detail each side.
How do I decide for a new project?
Start relational unless a specific access pattern clearly demands something else, and add specialised stores when measurements show the need. Write down the five most frequent reads and writes and their expected volumes; if they are lookups by one key at huge rates, or appends at a scale one machine cannot absorb, pick the non-relational store built for that. Our DBMS article covers how both families manage data internally.
Machines for SQL and non-relational stores
| Model | Processor | Cores | Memory | Drives | Port | Per month |
|---|---|---|---|---|---|---|
| ESSENTIAL-S | AMD Ryzen 7 9700X | 8 | 64 GB | 2x 512 GB SSD NVMe | 1 Gbps unmetered | $46.20 |
| ESSENTIAL-L | AMD Ryzen 9 9950X | 16 | 128 GB | 2x 960 GB SSD NVMe | 1 Gbps unmetered | $106.20 |
| BUSINESS-3 2024 | AMD EPYC 4464P | 12 | 64 GB | 2x 960 GB SSD NVMe | 3 Gbps unmetered | $141.60 |
| ENTERPRISE-a4 2026 | AMD EPYC TURIN 9455 | 48 | 128 GB | 2x 1.92 TB SSD NVMe | 5 Gbps unmetered | $510.00 |
Related pages
Non-relational database
Databases that store data as documents, keys, columns or graphs instead of fixed tables: how each model works and when it beats SQL.
Read moreMySQL
The open-source relational database behind countless web applications: InnoDB, replication, versions, MariaDB, tuning and running it on bare metal.
Read moreDBMS
What a database management system does beyond storing data: queries, transactions, concurrency, recovery, security, and the main families in use today.
Read moreDatabase servers
NVMe machines with large memory for PostgreSQL, MySQL, MariaDB and MongoDB, from a single primary to replicated pairs.
Read moreQuestions and answers
Which is faster, SQL or NoSQL?
Neither in general. Non-relational stores are faster for the narrow access pattern they are designed for; relational databases are faster and simpler for flexible queries and joins.
Can one application use both kinds of database?
Yes, and many do: a relational database as the source of truth with a cache, search engine or time-series store beside it.
Do non-relational databases support ACID transactions?
Some do for single records and a growing number for several records, but multi-table transactions remain a strength of relational databases.
Is a relational database enough for a large website?
Usually yes. A well-tuned PostgreSQL or MySQL server on a machine with ample memory and NVMe serves very large sites, with replicas for extra read capacity.
When should I choose a wide-column database?
When write volumes are too large for one machine and data can be partitioned by a key, such as event or sensor streams from many sources.