🗄️Developer

SQLite for Web Apps: More Capable Than You Think

SQLite has a reputation as a toy database. That reputation is wrong. Here's when SQLite is the right choice and how to use it effectively.

7 min readFebruary 2, 2026By FreeToolKit TeamFree to read

The 2025 developer landscape includes tools like Turso, Cloudflare D1, and Bun's built-in SQLite that are driving a SQLite renaissance. Here's why that's happening and whether you should care.

Why SQLite Got a Bad Reputation

SQLite's documentation literally says 'SQLite is not a client/server database engine. Rather, it is embedded into the end program.' That made a whole generation of developers assume it was only for embedded applications, desktop software, mobile apps. Not for web servers.

That assumption stuck even as SQLite's performance improved dramatically. The file-based design meant 'serverless' to developers meant 'toy.' But server-based databases aren't inherently faster — network round trips to a database server are often slower than local disk reads.

The Performance Reality

A SQLite database on the same server as your application can respond to queries in microseconds. PostgreSQL on a separate server needs 1-5ms per query just for network transport. For an API that makes 10 database queries per request, that's 10-50ms of avoidable latency.

Enable WAL mode and you get concurrent readers without blocking. For read-heavy applications — blogs, documentation sites, dashboards — SQLite can outperform a networked PostgreSQL in latency while being cheaper and simpler to operate.

The New SQLite Ecosystem

Turso distributes SQLite across edge locations, giving you SQLite's simplicity with global low latency. Cloudflare D1 is SQLite on Cloudflare Workers. Bun includes a built-in SQLite driver. LibSQL (the underlying library Turso uses) adds features like replication and branching that traditional SQLite lacks.

This isn't SQLite as a stepping stone to 'real' databases. It's SQLite as a first-class production choice for appropriate workloads.

When to Reach for Something Else

High concurrent writes. Multiple servers writing to the same database simultaneously. Complex JSONB queries. Full-text search at scale. Geographic queries. If you need any of these, PostgreSQL is the right choice. For everything else, consider whether SQLite's simplicity — single file, no server process, zero configuration — is actually an advantage.

Frequently Asked Questions

Can SQLite handle production traffic?+
For most applications, yes. SQLite handles thousands of reads per second without any issues. It also handles hundreds of writes per second with WAL mode enabled. The misconception comes from SQLite's file-based design — people assume file = slow and single-user. Neither is true. SQLite is used in production by Apple (iOS stores app data in SQLite), Firefox (browser history), and many other large-scale applications. The actual limit is concurrent writers: SQLite uses database-level locking, so high write concurrency (hundreds of simultaneous writes) is where PostgreSQL or MySQL genuinely outperforms it.
When should I choose PostgreSQL over SQLite?+
Choose PostgreSQL when you need: concurrent writes from multiple processes or servers, advanced data types (arrays, JSONB with indexing, geometric types), row-level security, full-text search at scale, or replication. If you're running a single-server application with moderate write volumes, SQLite will serve you well. The tipping point is roughly when you need to scale writes across multiple processes. For read-heavy applications, SQLite with proper indexing can serve millions of users from a single server — it's not the toy database its reputation suggests.
What is WAL mode in SQLite and should I use it?+
WAL stands for Write-Ahead Logging. It's a SQLite journal mode that dramatically improves concurrent read performance. In default journal mode, readers and writers block each other. In WAL mode, readers don't block writers and writers don't block readers. Enable it with: PRAGMA journal_mode = WAL. You should almost always use WAL mode for web applications. The only downside is that WAL creates additional files (-wal and -shm alongside your .db file), which complicates some backup approaches. Enable WAL mode and use PRAGMA synchronous = NORMAL along with it for best performance.
How does SQLite work with ORMs like Prisma or Drizzle?+
Both Prisma and Drizzle ORM support SQLite as a database provider. The setup is straightforward: specify sqlite as the database type, point to your .db file path, and the ORM handles query generation. Drizzle has become particularly popular with SQLite in serverless contexts because it's lightweight and can use libsql (the Turso fork of SQLite) which supports distributed SQLite. Prisma's SQLite support is mature and stable. Both work well for local development and production single-server deployments. The main limitation is that SQLite migrations are more restrictive than PostgreSQL — you can't easily add constraints or change column types in existing tables.

🔧 Free Tools Used in This Guide

FT

FreeToolKit Team

FreeToolKit Team

We build free browser-based tools and write practical guides that skip the fluff.

Tags:

developerdatabasesqlitebackend