IBRAVRA Media Network
Comparisons • 12 min read

PostgreSQL vs MySQL vs SQLite: The Database Selection Playbook

PostgreSQL, MySQL, and SQLite are not three versions of the same choice. The licence you ship under, the number of simultaneous writers, and the managed price at your workload decide it — and the numbers are reproducible: a 281-terabyte SQLite ceiling, a single writer, and a 0.234 CU break-even between serverless PostgreSQL and a managed node.

By Enow A. Jovial • Published 2026-11-17
PostgreSQL, MySQL, and SQLite are not three versions of the same choice. PostgreSQL is the general-purpose server engine with the most permissive licence. MySQL is the web's default server engine with a GPL licence that changes what you can embed. SQLite is not a server at all — it is a library that turns a file into a database, and its limits are concurrency limits, not size limits. Pick by write pattern and licence first.

The decision in one paragraph

Most teams choose by habit: MySQL because the tutorial used it, PostgreSQL because the framework defaulted to it, SQLite because the prototype shipped with it. Habit is a bad selector: the three engines differ on the licence you ship under, the number of simultaneous writers, and the managed price at your workload. This playbook runs the decision as an operator problem: the licence table, the concurrency mechanics, the size math, and the reproducible monthly cost at stated workloads, from the vendors' own pricing pages. The rule at the end picks the engine from two numbers — concurrent writers and monthly rows read — instead of from habit.

The three engines, honestly described

Start with the licence: it is the only property you cannot change later without migrating.

EngineLicenceWhat it means for youAuthority
PostgreSQLPostgreSQL Licence — permissive, free and open source in perpetuityUse, copy, modify, and distribute for any purpose, without fee and without a written agreement; no copyleft on your codepostgresql.org/about/licence
MySQL 8.4 CommunityGNU General Public License v2The server is GPLv2; distributing it inside a closed-source product requires Oracle's commercial licenceOracle, MySQL 8.4.13 Community Licensing Information, September 2026
SQLitePublic domainAll code and documentation dedicated to the public domain; no licence, no fee, no attribution requirementsqlite.org/copyright.html

PostgreSQL's licence is the most permissive of the three: permission to use, copy, modify, and distribute the software and its documentation for any purpose, without fee and without a written agreement, and the project states it is committed to making PostgreSQL available as free and open source software in perpetuity. MySQL's position is different in kind, not degree. Oracle's own licensing manual for MySQL 8.4.13 Community states the release is under version 2 of the GNU General Public License, with additional permissions. GPLv2 is a copyleft licence: if you distribute MySQL Community Server as part of a product, the GPL terms attach to the distribution. Running MySQL as your own backend does not trigger that obligation — the GPL governs distribution, not use — but shipping the server inside a product you sell needs Oracle's commercial licence. SQLite has no licence at all: the code and documentation have been dedicated to the public domain by the authors. You can embed SQLite in anything, ship it anywhere, and owe nobody a fee or a notice.

The second property is architecture. PostgreSQL and MySQL are client/server engines: a server process owns the data, clients connect over a socket, and the server arbitrates every read and write. SQLite is a library linked into your application: no server process, no socket, no separate user to create. The SQLite documentation states this directly — SQLite is not directly comparable to client/server SQL database engines such as MySQL, Oracle, PostgreSQL, or SQL Server. That is the reason SQLite needs no administration, no configuration, and no running process — and the reason the concurrency rules below are different in kind.

Concurrency: where the engines actually differ

The question that decides between these engines is not "how much data" but "how many writers at once."

PostgreSQL answers with Multiversion Concurrency Control. The documentation describes a multiversion model in which each SQL statement sees a snapshot of data as it was some time ago, regardless of the current state of the underlying data. Readers never block writers and writers never block readers, because a statement reads the version of the row that was current when the statement began. Old row versions accumulate until vacuumed, but dozens of concurrent writers proceed without serializing on each other.

MySQL's InnoDB answers with row-level locking. The MySQL manual states that InnoDB implements standard row-level locking, with two types of locks: shared (S) locks, which permit the transaction holding the lock to read a row, and exclusive (X) locks, which permit it to update or delete a row. The machinery extends to record locks, gap locks, and next-key locks that protect ranges during an index scan. The practical shape is different from PostgreSQL's: a writer locks the rows it touches, and another writer touching the same rows waits. For the common web workload — many readers, a few writers touching different rows — the difference is invisible. For a hot row, a counter, or a queue table, the difference is the whole performance story: InnoDB serializes on the locked row, PostgreSQL versions around it.

SQLite answers with a single writer. The SQLite documentation is explicit: the engine allows an unlimited number of simultaneous readers, but it will only allow one writer at any instant in time. Writers queue up; each application does its database work quickly and moves on, and no lock lasts for more than a few dozen milliseconds. For a low-to-medium traffic website that queue is invisible; for a write-heavy API with dozens of concurrent inserts, the queue becomes the latency. The rule that follows is mechanical: count your concurrent writers. One writer, or a handful of writers each holding the lock for milliseconds, and SQLite is free and fast. Sustained concurrent writers, and you need a server engine.

The size ceiling that isn't

The most repeated objection to SQLite is size, and the vendor's own numbers disprove it. The SQLite limits page states the maximum size of a database file is 4,294,967,294 pages, and at the maximum page size of 65,536 bytes this translates into approximately 2.8e+14 bytes — about 281 terabytes. The theoretical maximum rows in a table is 2 to the 64th power, about 1.8e+19 — unreachable, because the maximum database size is reached first.

One million rows at roughly one kilobyte per row is a one-gigabyte file — 1/281,000 of the ceiling, about 0.00036%. A hundred million rows is 100 gigabytes, still 0.036% of the ceiling. The ceiling is not the constraint: the single writer, the absence of a network server, and the absence of built-in replication are. SQLite works well for embedded devices and the internet of things, and for most low-to-medium traffic websites. It is the wrong engine where you need a server process, replication, or dozens of concurrent writers — a workload property, not a size property.

SQLite limits: maximum database size about 281 terabytes
SQLite limits: maximum database size about 281 terabytes

Managed cost: same node, three prices

The managed price is where the three engines stop looking different. DigitalOcean publishes one managed-database price table that covers both PostgreSQL and MySQL: the same node sizes, the same rates, the same storage price for both engines. The engine does not change the bill; the node does.

NodevCPUsStorage rangeMonthly node priceAuthority
1 GiB RAM110–30 GiB$15.15DigitalOcean pricing
2 GiB RAM130–60 GiB$30.45DigitalOcean pricing
4 GiB RAM260–120 GiB$60.90DigitalOcean pricing
8 GiB RAM4140–280 GiB$122.10DigitalOcean pricing
16 GiB RAM6290–580 GiB$244.35DigitalOcean pricing

Storage is $0.215 per GiB per month on top of the node price, in 10 GiB increments. The monthly total for the smallest production node with 30 GiB of storage:

DO Monthly=$15.15+(30×$0.215)=$15.15+$6.45=$21.60\text{DO Monthly} = \$15.15 + (30 \times \$0.215) = \$15.15 + \$6.45 = \$21.60
DigitalOcean managed databases: MySQL and PostgreSQL node pricing from $15.15 per month
DigitalOcean managed databases: MySQL and PostgreSQL node pricing from $15.15 per month

That is $259.20 per year, the same $21.60 for both engines. Between the two server engines, the decision is licence, concurrency, and features — not price. The price choice appears when you compare managed nodes against serverless pricing.

Neon sells PostgreSQL by compute unit. Its Free plan is $0 with 100 CU-hours per month per project and 1 GiB of storage. Its Launch plan is $0.106 per CU-hour and $0.35 per GiB-month of storage, with a typical spend of $15 per month. Its Scale plan is $0.222 per CU-hour with a typical spend of $701 per month. Turso sells SQLite by rows. Its Free plan is $0 with 100 databases, 5 GiB of storage, 500 million rows read per month, and 10 million rows written per month. Its Developer plan is $4.99 per month with 9 GiB of storage plus $0.75 per GiB over, 2.5 billion rows read plus $1 per billion over, and 25 million rows written plus $1 per million over. Its Scaler plan is $24.92 per month with 24 GiB plus $0.50 per GiB and 100 billion rows read. PlanetScale, the MySQL-compatible serverless option, lists single-node databases starting at $5 per month.

Run the serverless numbers at the same workload. A Neon Launch database averaging 0.25 CU with 10 GiB of storage:

Neon Monthly=(0.25×730×$0.106)+(10×$0.35)=$19.35+$3.50=$22.85\text{Neon Monthly} = (0.25 \times 730 \times \$0.106) + (10 \times \$0.35) = \$19.35 + \$3.50 = \$22.85

A Turso Developer database at 14 GiB of storage, inside its included rows:

Turso Monthly=$4.99+(5×$0.75)=$4.99+$3.75=$8.74\text{Turso Monthly} = \$4.99 + (5 \times \$0.75) = \$4.99 + \$3.75 = \$8.74

The Turso bill is lower because the workload is priced in rows, not in a running node — and because SQLite has no server to keep warm. At low, bursty usage the row-priced SQLite service wins; at sustained usage the node-priced server engine wins; and between the two server engines the managed node price is identical, so the decision is made on licence and concurrency, not on the bill.

Do not embed MySQL Community Server inside a product you sell without reading the GPLv2 terms in Oracle's licensing manual first. Running MySQL as your own backend is use, not distribution, and does not trigger the copyleft obligation. Shipping the server inside a closed-source product is distribution — and that is the act that needs Oracle's commercial licence, or a switch to PostgreSQL or SQLite. The licence decision is cheapest at the start of the project and most expensive after the first customer ships.

The break-even formula

The break-even between a serverless PostgreSQL and a managed node is a single equation. Let CU be the average compute units and S the storage in GiB:

Neon Monthly=(CU×730×$0.106)+(S×$0.35)\text{Neon Monthly} = (\text{CU} \times 730 \times \$0.106) + (S \times \$0.35)
DO Monthly=$15.15+(S×$0.215)\text{DO Monthly} = \$15.15 + (S \times \$0.215)

Set them equal at 10 GiB of storage:

730×CU×0.106+3.50=15.15+2.15730 \times \text{CU} \times 0.106 + 3.50 = 15.15 + 2.15
CU=17.3077.38≈0.234\text{CU} = \frac{17.30}{77.38} \approx 0.234

Below about 0.23 average compute units, Neon is cheaper. At 0.1 CU the Neon bill is $11.24 in total — about half the managed node. At 1.0 CU it is $80.88 — nearly four times the managed node. The managed node is flat price for flat capacity; the serverless price is a meter on actual use. Measure your average compute for a week before you choose, and re-run the equation when the workload changes. Test the same arithmetic on your own numbers with the break-even calculator before committing to a tier.

Founder & CEO Insight — Enow A. Jovial

"The database decision is the one founders get backwards most often: they pick by benchmark, then discover the licence, the writer queue, or the bill. I have watched teams migrate off MySQL because the GPL blocked a distribution deal, and off SQLite because a queue table turned the single writer into a traffic jam. Neither migration was hard — both were avoidable. Count your writers, read the licence, run the break-even. Three numbers, decided in an afternoon, and you never migrate again."
— Enow A. Jovial, Founder & Chief Executive Officer

Who should not use each engine

PostgreSQL is the wrong choice where you need a zero-administration embedded database, or where the deployment target has no server process at all — a mobile app, a desktop app, a single-file tool. MySQL is the wrong choice where you will distribute the database server inside a closed-source product, unless you have budgeted Oracle's commercial licence. SQLite is the wrong choice where you need concurrent writers, network access, or built-in replication — see the PostgreSQL connection pooling playbook for why server engines need connection management a library never needs.

The confusing case is the edge database. Cloudflare D1 is SQLite at the edge, and the Workers D1 vs Hyperdrive benchmark measures exactly the workload SQLite is built for: many readers, few writers, data close to the user. If your workload looks like that benchmark, the SQLite family is the right answer at the edge and at the center. If it looks like a queue, a ledger, or a multi-writer API, the server engines are the right answer — licence first, concurrency second, price last.

The operator sequence

  1. Count concurrent writers. Instrument the busiest endpoint for a week. One writer, or writers holding the lock for milliseconds, points to SQLite. Sustained concurrent writers point to a server engine.
  2. Read the licence against your distribution plan. Shipping the database inside a product you sell changes the MySQL answer.
  3. Measure average compute. Below 0.23 CU, serverless PostgreSQL beats the managed node; above it, the node wins.
  4. Measure monthly rows read and written. Compare against Turso's included allowances before assuming the row-priced bill stays small.
  5. Price the managed node at your storage. Node price plus $0.215 per GiB, and confirm the storage range covers your data.
  6. Prototype the hot path. Run the busiest write pattern against the chosen engine for a day. A hot-row lock or a writer queue shows up in hours, not months.
  7. Decide on the three numbers and document the decision with the numbers attached.

Operator checklist

  • [x] Concurrent writers counted: busiest endpoint instrumented for a week.
  • [x] Licence read against the distribution plan: MySQL GPLv2 consequence checked.
  • [x] Average compute measured: Neon vs managed-node break-even computed at 0.234 CU.
  • [x] Monthly rows measured: reads and writes compared against Turso's allowances.
  • [x] Managed node priced: node price plus $0.215 per GiB at the required storage.
  • [x] Hot path prototyped: busiest write pattern run against the chosen engine for a day.
  • [x] Decision documented: writers, licence, and break-even numbers recorded with the choice.
  • [x] Migration path noted: the engine you would move to if the writer count or the distribution plan changes.