9bNine Bits

SQLite vs PostgreSQL: Which Should You Choose?

Choose SQLite when one application owns the data and PostgreSQL when several clients need to write concurrently over a network. SQLite is an in-process library with no separate server; PostgreSQL is a client-server database with row-level locking, enforced types and a large extension ecosystem.
SQLite vs PostgreSQL: Which Should You Choose?

SQLite or PostgreSQL: the decision summary

The two are not really competing for the same job. SQLite is an in-process library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. PostgreSQL is an object-relational database server that many applications connect to at once. Choose SQLite for mobile and desktop apps, local caches, command-line tools, test suites, and edge or embedded devices where one process owns the data. Choose PostgreSQL when several processes or users write concurrently, when you need centrally administered access control over a network, or when you need its richer SQL, data types and extensions.

CriterionSQLitePostgreSQL
ArchitectureIn-process library, no separate server processClient-server, reached over TCP or a Unix socket
StorageTables, indices, triggers and views in a single disk fileManaged by the server process
Consistency and transactionsFull ACID transactions on a single file, holding even through system crashes and power failuresFull ACID transactions via MVCC
Concurrency / write modelOne writer at a time per database fileRow-level locking, many concurrent writers
Column typesDynamic typing with type affinity; declared types not enforced by defaultStatic, enforced column types
ScalingVertical only; limits of 281 terabytes per database and 1 gigabyte per rowVertical plus replicas, partitioning and distributed-sharding extensions
FootprintLibrary under 900KiB with all features enabledStandalone server, administered independently
LicensePublic domainPostgreSQL License (OSI-approved, no fee even for commercial products)
Managed offeringsNothing to manage: it ships inside your applicationWidely offered as a managed service
Current release (22 Nov 2026)3.54.1 (2026-10-16)19 (2026-11-19), the 36th major release
Typical useEmbedded, mobile, desktop, local/edge, testingMulti-user applications, networked services, analytics

Concurrency and write locking

This is the difference that causes the most production surprises. SQLite has no server process, so every connection works directly on the database file and writes are coordinated by locking that file. Only one writer can commit at a time per database file, and there is no way to have two writers touching different rows of the same file in parallel.

PostgreSQL uses multiversion concurrency control (MVCC) with row-level locking. Many clients can write to different rows, or even the same table, at the same time, and the server manages visibility and conflicts through transaction isolation levels. If more than one process or user writes at the same time, this is usually the deciding factor in favor of PostgreSQL. A single-process desktop or mobile app, by contrast, never hits SQLite's write ceiling because there is only ever one writer.

A practical test: if your write path can be funneled through one process or a short queue, SQLite will likely keep up. If writers arrive from several application servers, you need a database server.

Data types and type affinity

SQLite does not enforce declared column types by default. It uses dynamic typing with type affinity: a declared type guides how a value is stored, but it does not strictly constrain what you can insert, so a text string can land in a column declared INTEGER. Data-quality rules that PostgreSQL would enforce for you must be checked in your application or with constraints.

PostgreSQL enforces column types at write time and offers a much larger catalog: arrays, ranges, enumerated types, network address types, and native JSON/JSONB with indexing support. Users can also add data types, functions, operators, aggregate functions, index methods and procedural languages, so the type system extends beyond what ships in the box.

-- PostgreSQL: enforced type, indexable JSONB
CREATE TABLE events (
  id BIGINT PRIMARY KEY,
  payload JSONB NOT NULL
);
CREATE INDEX ON events USING GIN (payload);

Deployment: embedded library vs client-server

SQLite ships as a library linked into your application, and the whole source is distributed as a single file, sqlite3.c. With all features enabled the library can be under 900KiB. There is no service to install, no port to open and no separate configuration to tune, which is why SQLite is the default storage for mobile apps, browsers and countless command-line tools. The file format is cross-platform and can be copied between 32-bit and 64-bit and between big-endian and little-endian systems, and the US Library of Congress recommends SQLite database files as a storage format.

PostgreSQL runs as a standalone server process that listens for connections and is administered independently of any one application: you create roles, databases and extensions, and tune server-level settings such as memory and connection limits. Applications connect through a client library over the network or a local socket, and multiple unrelated applications can share the same server. The project ships a new major version every year, with quarterly patch releases in February, May, August and November, so plan an upgrade cadence.

Many web frameworks default to SQLite for local development and tests, then run PostgreSQL in staging and production. That workflow is convenient, but test against the database you deploy before release: differences in type coercion, constraint enforcement and SQL feature support can surface only under PostgreSQL's stricter rules.

Backups and durability

Because a SQLite database is a single file, backing it up is conceptually simple: copy the file. A plain copy is only safe while no connection is writing to it, so for a live database use SQLite's own backup facilities rather than copying files under a running application. Durability per transaction is tunable through SQLite's pragmas, trading some commit safety for throughput, while the engine's ACID guarantee is designed to hold across system crashes and power failures.

PostgreSQL has a broader backup stack: logical dumps for individual databases, physical backups combined with continuous archiving for point-in-time recovery, and replication to standby servers for failover. This is what you want when losing the last few minutes of data is unacceptable and when the database must stay up while a node is replaced. Check the backup chapter of the PostgreSQL documentation for the tools that match your recovery targets.

Scaling, SQL features, and when to move

SQLite scales read throughput well on a single machine, and its limits are generous: up to 281 terabytes per database and 1 gigabyte per row, far more than most readers assume an embedded database can hold. Write throughput, though, is capped by the single-writer rule regardless of hardware, and SQLite has no built-in replication or sharding.

PostgreSQL scales vertically, and horizontally through read replicas, external connection poolers, table partitioning and distributed-sharding extensions. Its extension ecosystem covers spatial data, vector search, full-text search, foreign data wrappers and graph queries (Apache AGE is one open-source option for the last). Version 19 adds REPACK (CONCURRENTLY), which reclaims table bloat without blocking reads or writes and replaces VACUUM FULL and CLUSTER.

  • SQLite covers CTEs, window functions, a solid expression language, built-in full-text search and JSON functions.
  • PostgreSQL supports the full range of standard SQL, procedural languages such as PL/pgSQL, and a large catalog of community and vendor extensions.

Stay on SQLite when a single process owns the data: mobile and desktop applications, browser and edge storage, IoT devices, local caches, most automated tests and prototypes. Move to PostgreSQL when you need concurrent writers across a network, centralized access control, replication and failover, large analytical workloads, or SQL features and extensions SQLite does not provide.

Moving from SQLite to PostgreSQL is a well-trodden path: export the schema and data, load them into PostgreSQL, and review the resulting column types, since SQLite's dynamic typing can map ambiguously. Moving the other direction usually only makes sense for shipping a read-only subset of a PostgreSQL database inside an embedded app.

Common questions

Is SQLite good enough for production use?

Yes, for workloads where one process or a small number of processes access the database and write concurrency is low. It is the most widely deployed database in the world, used in mobile apps, desktop software and embedded systems. It becomes a poor fit once multiple processes need to write at the same time over a network.

Does SQLite support multiple users writing at once?

Multiple connections can use the same database file, but only one writer can commit at a time for the whole file. PostgreSQL allows many concurrent writers through MVCC and row-level locking.

Is SQLite ACID compliant?

Yes. SQLite transactions are atomic, consistent, isolated and durable, and they hold even if interrupted by a system crash or power failure. PostgreSQL is also fully ACID compliant and uses MVCC to manage isolation between concurrent transactions.

Can I start with SQLite and move to PostgreSQL later?

Yes, this is a common pattern. Export the schema and data, load them into PostgreSQL, and check type mappings afterward, since SQLite's dynamic typing and relaxed constraints do not map one-to-one onto PostgreSQL's enforced types.

Sources

  1. SQLite: About SQLite
  2. SQLite: Home Page (current release)
  3. PostgreSQL Documentation: What Is PostgreSQL?
  4. PostgreSQL: Press FAQ

About this page

Last reviewed November 23, 2026 by the Nine Bits editors. Read our editorial policy or report an error.