← Back to articles

SQLite vs PostgreSQL vs MySQL: Which Database to Choose (2026)

The database decision shapes everything downstream — ORM choice, hosting, scaling strategy, and even what features you can build. In 2026, these three relational databases dominate, but they serve fundamentally different use cases.

Quick Comparison

FeatureSQLitePostgreSQLMySQL
ArchitectureEmbedded (file-based)Client-serverClient-server
Best forSmall-medium apps, embeddedComplex apps, analyticsWeb apps, read-heavy
Concurrent writesLimited (WAL helps)ExcellentGood
JSON supportBasicExcellent (JSONB)Good (JSON)
Full-text searchFTS5 (basic)Excellent (tsvector)Good (FULLTEXT)
ExtensionsLimitedRich ecosystemLimited
ReplicationExternal tools (Litestream)Built-in (streaming)Built-in (primary-replica)
Max database size281 TB (theoretical)UnlimitedUnlimited
Cloud hostingTurso, LiteFSSupabase, Neon, RDSPlanetScale, RDS
LicensePublic domainPostgreSQL LicenseGPL v2
Hosting cost$0 (file on disk)$0-25/mo (managed)$0-25/mo (managed)

SQLite: The Embedded Database

SQLite isn't a database server — it's a C library that reads and writes directly to a file on disk. No network, no configuration, no daemon process.

When SQLite is Perfect

  • Single-server web apps. If your app runs on one server, SQLite is likely faster than PostgreSQL because there's no network round-trip.
  • Prototypes and MVPs. Zero setup. Your database is a file. Back it up by copying the file.
  • Embedded applications. Desktop apps, mobile apps, IoT devices, CLI tools.
  • Read-heavy workloads. SQLite handles thousands of concurrent reads with no contention.
  • Edge/serverless. With Turso or LiteFS, SQLite runs on the edge — database at the same location as your compute.

When SQLite Falls Short

  • High write concurrency. SQLite locks the entire database for writes (WAL mode helps but doesn't eliminate the bottleneck).
  • Multi-server deployments. SQLite doesn't natively support replication. Tools like Litestream and LiteFS add this, but it's not built-in.
  • Complex queries. Fewer data types, limited window functions (improving), no materialized views.
  • Team development. No user management, no role-based access, no audit logging.

The SQLite Renaissance (2026)

SQLite is having a moment. Tools making it viable for production web apps:

  • Turso: Managed SQLite on the edge with replication
  • LiteFS: Distributed SQLite from Fly.io
  • Litestream: Streaming SQLite replication to S3
  • libSQL: Fork of SQLite with server mode and extensions
  • PocketBase, Bun, Drizzle: All have first-class SQLite support

PostgreSQL: The Powerhouse

PostgreSQL is the most advanced open-source relational database. If you need it to do something, PostgreSQL probably can.

When PostgreSQL Shines

  • Complex data models. Foreign keys, constraints, views, materialized views, CTEs, window functions — PostgreSQL handles the most complex queries.
  • JSONB. Store and query JSON data with full indexing. Combine relational and document models in one database.
  • Extensions. pgvector (AI embeddings), PostGIS (geospatial), pg_cron (scheduled jobs), pg_stat_statements (query analysis), TimescaleDB (time-series).
  • Full-text search. tsvector + tsquery provides powerful text search without Elasticsearch.
  • Concurrency. MVCC handles thousands of concurrent readers and writers.
  • Row-Level Security. Define access policies at the database level. Critical for multi-tenant SaaS.
  • Analytics. Window functions, CTEs, and extensions like Citus make PostgreSQL viable for analytical workloads.

When PostgreSQL is Overkill

  • Simple apps with one server. SQLite is simpler and often faster for basic CRUD.
  • Extremely high write throughput. For millions of writes/second, consider specialized databases.
  • When you just need a cache. Use Redis.

PostgreSQL in 2026

PostgreSQL is the default database for web applications. Managed options make it accessible:

  • Supabase: PostgreSQL + auth + real-time + storage
  • Neon: Serverless PostgreSQL with branching
  • Vercel Postgres: Neon-powered, Vercel-integrated
  • Railway/Render: Simple managed PostgreSQL
  • AWS RDS / Google Cloud SQL: Enterprise-grade managed

MySQL: The Web Standard

MySQL powered the web for two decades (WordPress, Facebook, Uber). In 2026, it remains the most deployed database globally.

When MySQL Works Well

  • Read-heavy web apps. MySQL's InnoDB engine is optimized for read-heavy workloads. Blog, e-commerce, content sites.
  • WordPress / PHP ecosystem. If you're using WordPress, Laravel, or PHP, MySQL is the natural fit.
  • Replication. MySQL's primary-replica replication is well-understood and battle-tested.
  • Existing infrastructure. If your team knows MySQL, switching costs may outweigh PostgreSQL's advantages.

When to Choose PostgreSQL Over MySQL

  • Complex queries. PostgreSQL's query planner is more sophisticated.
  • JSON workloads. PostgreSQL's JSONB is significantly more powerful than MySQL's JSON.
  • Extensions. PostgreSQL's extension ecosystem has no MySQL equivalent.
  • Data integrity. PostgreSQL defaults to strict mode; MySQL historically had loose defaults that could silently corrupt data.
  • Modern tooling. Most new ORMs, frameworks, and tools prioritize PostgreSQL.

MySQL in 2026

MySQL remains relevant but is losing ground to PostgreSQL for new projects:

  • PlanetScale: Serverless MySQL with branching (built on Vitess). Note: PlanetScale removed its free tier in 2024.
  • AWS RDS / Aurora: Managed MySQL at any scale.
  • MariaDB: Community fork with additional features.

Performance Comparison

Read Performance

ScenarioSQLitePostgreSQLMySQL
Simple SELECT by PKFastest (no network)FastFast
Complex JOIN (10+ tables)AdequateFastestGood
Full-text searchBasicExcellentGood
JSON queriesSlowFast (JSONB indexed)Moderate

Write Performance

ScenarioSQLitePostgreSQLMySQL
Single writerFastFastFast
100 concurrent writersBottleneckExcellentGood
Bulk insertsFast (single file)Fast (COPY)Fast (LOAD DATA)
TransactionsGood (WAL)ExcellentGood

Bottom Line on Performance

For single-server apps with moderate traffic: SQLite is often the fastest because it eliminates network overhead. For multi-server or high-concurrency: PostgreSQL wins. MySQL sits between them.

Decision Framework

Choose SQLite When:

  • ✅ Single-server deployment
  • ✅ Read-heavy workload (< 100 writes/second)
  • ✅ Prototype or MVP
  • ✅ Embedded application (desktop, mobile, CLI)
  • ✅ You want zero infrastructure complexity
  • ✅ Edge deployment (Turso, Fly.io)

Choose PostgreSQL When:

  • ✅ Multi-server or cloud deployment
  • ✅ Complex data models with relationships
  • ✅ Need JSON (JSONB), geospatial (PostGIS), or vectors (pgvector)
  • ✅ Row-Level Security for multi-tenant SaaS
  • ✅ You might need full-text search
  • ✅ New project (default choice in 2026)

Choose MySQL When:

  • ✅ WordPress or PHP ecosystem
  • ✅ Team expertise is in MySQL
  • ✅ Read-heavy workload with simple queries
  • ✅ Existing MySQL infrastructure
  • ✅ Using PlanetScale (Vitess-based)

Migration Paths

SQLite → PostgreSQL

Common path as apps grow. Most ORMs (Prisma, Drizzle) make this a config change + data migration. SQL syntax is mostly compatible. Plan for 1-2 days of work.

MySQL → PostgreSQL

More involved. Data types, functions, and syntax differ. Tools like pgLoader automate data transfer. Plan for 1-2 weeks for a medium app.

PostgreSQL → SQLite

Rare and usually unnecessary. If you're downsizing, the ORM layer makes this feasible.

FAQ

Is SQLite really good enough for production?

Yes, for many production apps. Basecamp, Pieter Levels' products, and many others run SQLite in production. The key constraint is single-server deployment and moderate write concurrency.

Should I start with SQLite and migrate later?

If using an ORM (Prisma, Drizzle), yes — migration is straightforward. If writing raw SQL, starting with PostgreSQL avoids migration headaches later.

What about NewSQL databases (CockroachDB, TiDB)?

These are PostgreSQL/MySQL-compatible distributed databases for global scale. Overkill for 99% of projects. Consider them when you need multi-region, globally distributed transactions.

Which is cheapest to run?

SQLite: $0 (it's a file). PostgreSQL: $0 (Supabase/Neon free tier) to $25/month (managed). MySQL: $0 to $25/month (managed).

The Verdict

  • SQLite for simplicity, single-server apps, and edge deployments. The underrated choice that's gaining momentum.
  • PostgreSQL for everything else. The default database for new web projects in 2026.
  • MySQL when your ecosystem demands it (WordPress, existing infrastructure, team expertise).

For new projects: start with PostgreSQL unless you have a specific reason for SQLite (simplicity) or MySQL (ecosystem). You won't regret having PostgreSQL's capabilities available when you need them.

Get AI tool guides in your inbox

Weekly deep-dives on the best AI coding tools, automation platforms, and productivity software.