Software

SQLite vs PostgreSQL: Which Database Fits Your Project

By Joe Manning 3 views 8 min read
SQLite vs PostgreSQL: Which Database Fits Your Project

The real question behind SQLite vs PostgreSQL isn't how big your app will get. It's whether more than one process ever needs to write to your database at the same moment. SQLite serializes every write through a single lock, while PostgreSQL uses multiversion concurrency control (MVCC) so writers and readers rarely block each other, according to PostgreSQL's own documentation. Get that one distinction right and the rest of the decision, hosting, backups, and how your app scales, mostly falls into place on its own.

Key takeaways

  • SQLite allows unlimited concurrent readers but only one writer at a time, even in WAL mode, according to SQLite's own documentation.
  • SQLite's own site says sites under roughly 100,000 hits per day are a safe target, and that the engine has been shown to handle about 10 times that figure.
  • PostgreSQL 18, released on September 25, 2025 according to the PostgreSQL project's release notes, uses MVCC so reads never block writes and writes never block reads, the opposite of SQLite's single-writer model.
  • Edge SQLite platforms such as Cloudflare D1 (capped at 10 GB per database on paid plans, per Cloudflare's own docs) and Fly.io's LiteFS (which Fly.io itself calls "pre-1.0" and says it cannot support) inherit the same single-writer ceiling, just moved onto the network.

The Real Fork in the Road Is Concurrency, Not Scale

SQLite's own documentation is blunt about what the engine is for: it says SQLite "competes with fopen()," not with client-server databases. Client-server engines like PostgreSQL are built for shared, networked data with many simultaneous writers; SQLite is built for local storage inside a single application or device. Even in WAL (write-ahead log) mode, SQLite's documentation is explicit that a database can have any number of simultaneous readers, but only one writer at a time, because there is a single WAL file to write to.

PostgreSQL takes the opposite approach. Its own documentation describes MVCC as a system where each statement sees a consistent snapshot of the data, which means reads never block writes and writes never block reads, even at the strictest "serializable" isolation level. Two PostgreSQL writers only collide if they touch the same rows at the same time. That single architectural choice, one writer queue versus many concurrent writers resolved by row-level snapshots, is the actual fork in the road. Everything else, including dataset size, is downstream of it.

Advertisement

SQLite Handles More Traffic Than Most Developers Assume

Because "SQLite doesn't scale" has become a reflexive line, it's worth reading what SQLite's maintainers actually claim. Their own site states that any site getting fewer than 100,000 HTTP hits per day should work fine on SQLite, and calls that a conservative estimate, noting the engine has been shown to handle around 10 times that volume. As a real example, the SQLite project's own website reportedly ran on SQLite handling 400,000 to 500,000 HTTP requests a day, with roughly 200 SQL statements executed per page, on a single shared server.

The documented ceilings are real but generous: a single SQLite database file can grow to 281 terabytes (2^48 bytes) before hitting the format's own limit, and the practical constraint is usually the filesystem, not SQLite. The actual failure mode isn't size, it's write concurrency: if your write transactions are short (SQLite's docs note locks typically hold for only milliseconds), a single-server app can absorb a lot of writers taking turns before anyone notices queuing.

A laptop screen showing lines of code in an editor

PostgreSQL Earns Its Operational Overhead When Writes Multiply

PostgreSQL's overhead, a server process, connection pooling, backups, and someone who understands VACUUM and replication, buys you something SQLite structurally cannot offer: multiple independent services writing to the same tables at once without taking turns. That matters for a multi-tenant SaaS product, anything with background workers writing alongside the web app, or a dataset that needs to live across several machines. It's also why PostgreSQL remains the default behind managed platforms built specifically to remove the operational burden, from AWS RDS to newer serverless offerings like Neon and Supabase, which let teams get MVCC's concurrency guarantees without running their own database server.

Advertisement

This is also where format choice intersects with the rest of your stack. A team weighing Node.js, Deno, or Bun for the application layer, or deciding between Docker and Podman for how the database itself gets deployed, is really answering the same underlying question as the database choice: how many independent, concurrently-running pieces does this system actually have.

Rows of server racks in a data center corridor

The Edge SQLite Renaissance Comes With the Same Asterisk

SQLite has had a real resurgence through edge-native platforms that replicate a SQLite file across regions instead of running a traditional server. Cloudflare's own documentation caps a single D1 database at 10 GB on its paid Workers plan (500 MB on the free tier) and states plainly that the 10 GB ceiling "cannot be further increased," while allowing up to a million databases per paid account for sharded, per-tenant designs. Fly.io's LiteFS, which replicates SQLite across machines, is described in Fly.io's own docs as "stable and running in production environments," but the same page adds that the project "is still pre-1.0" and that Fly.io "cannot provide support or guidance for it," with an explicit warning against pairing it with autostop/autostart machines because stale data could trigger silent rollback.

✦ Free Newsletter ✦

Never miss a story

Tools, tutorials and AI deep-dives - straight to your inbox, every week.

No spam, unsubscribe any time.

None of that makes these platforms unusable, sharding by tenant is a legitimate way to work around the single-writer limit, but it does mean the underlying constraint followed SQLite to the edge rather than disappearing. Writes to one shard still queue behind each other; you've just distributed the queues instead of eliminating them.

Advertisement
DimensionSQLitePostgreSQL
Concurrency modelUnlimited readers, one writer at a time (per SQLite docs)MVCC: readers and writers rarely block each other (per PostgreSQL docs)
Admin overheadNone; it's a single file, no server processRequires a running server, connection pooling, and maintenance
Documented size ceiling281 TB per database file (SQLite docs)No fixed file-size ceiling; limited by storage and hardware
Typical deploymentEmbedded in the app, or edge-replicated (D1, Turso, LiteFS)Dedicated server or managed service (RDS, Neon, Supabase)
Production maturity signalCore engine is decades old; edge tooling (LiteFS, D1) is newer and sometimes pre-1.0PostgreSQL 18 shipped September 25, 2025 on a mature, long-supported release cycle

A Decision Rule You Can Actually Apply

Skip the abstract scalability debate and ask two concrete questions instead.

Close-up macro shot of a computer hard drive
  • Choose SQLite if: the data lives on one device or one server, your write transactions are short, and you want zero database administration, think a desktop app, a mobile app, an internal tool, a prototype, or a low-to-medium traffic website.
  • Choose PostgreSQL if: more than one service or server needs to write to the same data concurrently, you need complex queries, extensions, or strict multi-user isolation, or you expect to outgrow a single machine.
  • Choose edge SQLite (D1, Turso, LiteFS) if: you want SQLite's simplicity but need geographic read replication, and you're willing to design around per-tenant sharding to avoid a single global write bottleneck, and to accept that some of the tooling is younger and less battle-tested than PostgreSQL itself.

This matters most to solo developers, small teams shipping a new product, and anyone choosing a format for an application-embedded database or a low-traffic site, where SQLite's zero-admin model is a genuine advantage, not a compromise. It matters least to teams already running multi-service architectures with background workers, multiple writers, or compliance requirements around row-level access control; for them, PostgreSQL's operational cost is already justified before the first line of schema is written. If your project doesn't yet know which bucket it's in, default to SQLite for anything local or single-server; migrating a growing write-heavy workload to PostgreSQL later is a well-worn path, not a crisis.

The Counterargument: "Just Default to PostgreSQL" Has a Point

A fair number of experienced engineers argue you should skip this decision entirely and start every project on PostgreSQL, since migrating a database engine later is painful and PostgreSQL can run a single-server hobby project just fine. That's not a weak position: PostgreSQL's row-level MVCC means it doesn't actually punish you for having only one writer, so you lose little by starting there, and you avoid a future migration if the project does grow multi-writer needs you didn't anticipate.

Network cables plugged into a patch panel

The counterargument holds up best for anyone who expects to add teammates, background jobs, or a second service soon, where the "maybe I'll need it later" case is realistic rather than hypothetical. It holds up worst for single-developer tools, edge-deployed apps, and anything where "no database server to manage" is itself a feature, a desktop app that requires a user to run PostgreSQL locally is a worse product than one that just opens a file. The honest takeaway isn't that one side is wrong; it's that "default to Postgres" is really a bet on your future concurrency needs, while "default to SQLite" is a bet on your present simplicity needs, and only you know which bet your project is actually making.

Advertisement

If you're starting something new today: write down whether a second process will ever need to write to this data within the next year. If the honest answer is no, open a SQLite file and move on. If the answer is yes, or you can't rule it out, start with PostgreSQL, ideally on a managed host, so the operational cost is someone else's job instead of yours.

Sources

Joe Manning
Written by
Joe Manning, Senior Editor
Share this article:
Advertisement