PROVIDER - The most widely deployed embedded database
SQLite
SQLite is a public-domain embedded database storing everything in one file with zero configuration and operations plus excellent read performance, the default storage for mobile, desktop, edge, and test environments.
Service Overview
SQLite was created by D. Richard Hipp in 2000 and released into the public domain, needing no server process or configuration and storing the whole database in a single cross-platform file, embedded in nearly every phone, browser, and operating system as the most deployed database engine.
For Backend & Database work the value is zero operations, since no server means no connection pool, port, backup daemon, or network latency, reads are extremely fast, and transactions are ACID, making it the cheapest choice for local caches, desktop apps, edge devices, and automated test databases.
The boundaries are clear, because writes serialise with a single writer per database even in WAL mode, concurrent write throughput is weak, there is no user privilege system or network protocol, and some needs require extensions such as FTS5, JSON1, or R-Tree, so treating it as a server primary database leads to trouble.
Key Strengths
- Zero configuration and operations with one file as the database and a file copy as backup
- Public domain licensing brings no restrictions or fees for commercial use and distribution
- Excellent read performance with WAL mode allowing concurrent readers alongside one writer
- Consistent behaviour across platforms from phones to servers
Product Ecosystem
Core library and SQL dialect
It supports most SQL-92 syntax, CTEs, window functions, JSON1, FTS5 full-text search, and R-Tree spatial indexes, far more capable than its reputation suggests.
WAL and concurrency
WAL mode stops reads blocking writes yet keeps a single writer per database, so write-heavy concurrency needs application queuing or a server database.
Extensions and tools
The official CLI, DB Browser for SQLite, Litestream for incremental backup, and LiteFS for distribution form a workable ecosystem.
Limitations
- Writes serialise and become a bottleneck quickly under high concurrency
- No user or privilege system, so multi-tenant or direct multi-user access needs application-level control
- No network protocol, so remote access must route through an application service
- Very large databases see rising write and VACUUM maintenance costs
Use Cases
- Mobile and desktop local storage (★★★★★) - No operations, single-file distribution
- Edge devices and offline-first apps (★★★★★) - No network dependency, reliable transactions
- Automated testing and prototypes (★★★★★) - Instant in-memory databases
- Write-heavy server primary databases (★) - Serialised writes are unacceptable
Pricing
| Plan | Price | Scope |
|---|---|---|
| SQLite core library | $0 | Public domain with no fees |
| Backup and sync add-ons | Varies | Open source options like Litestream self-hosted |
| Managed SQLite services | Usage based | Edge replicas such as Turso |
SQLite itself is entirely free with no licensing limits, so cost shows up in engineering choices, since remote access, high availability, or multiple writers require a sync layer such as Litestream or LiteFS, or a server database.
FAQ
-
Can SQLite power a website? Low-traffic single-node sites can and skip all database operations, but once multiple instances, high write concurrency, or online scaling appear, migrate to PostgreSQL or MySQL early.
-
How does it scale with data volume? Reads stay strong into tens of gigabytes when indexes and queries are right, while writes and VACUUM slow as the file grows, signalling a split or engine change.
-
Can multiple processes write at once? No, there is one writer per database and WAL only allows concurrent readers, so parallel writes require a server database.
Code Examples
Create a table, insert rows, and query with the sqlite3 CLI
-- sqlite3 app.db < schema.sql
CREATE TABLE IF NOT EXISTS notes (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT NOT NULL,
body TEXT,
created_at TEXT NOT NULL DEFAULT (datetime('now'))
);
INSERT INTO notes (title, body) VALUES ('first', 'hello sqlite');
SELECT id, title, created_at
FROM notes
ORDER BY id DESC
LIMIT 5;
One .db file is the whole database, so backups are file copies (run PRAGMA wal_checkpoint first); keeping the file on the same host lets it use the filesystem cache, which over a network share is far slower.
WAL mode plus FTS5 full-text search
PRAGMA journal_mode = WAL;
CREATE VIRTUAL TABLE notes_fts USING fts5(
title, body, content='notes', content_rowid='id'
);
INSERT INTO notes_fts (notes_fts) VALUES ('rebuild');
SELECT rowid,
highlight(notes_fts, 1, '<b>', '</b>') AS snippet
FROM notes_fts
WHERE notes_fts MATCH 'sqlite'
ORDER BY rank
LIMIT 5;
FTS5 is a built-in extension and MATCH plus rank only work on the virtual table; external-content mode (content=) avoids duplicating text but needs a rebuild or triggers after data changes.
Community & Resources
Communities and official channels
- Official documentation — Authoritative notes on syntax, the C interface, and the file format.
- Command-line shell guide — The full list of
.mode,.dump, and.backupoperations. - Stack Overflow: sqlite — The largest Q&A pool for locking, concurrent writes, and migration issues.
Learning resources and tools
- Quickstart — Create, load, and query a database in fifteen minutes.
- SQL syntax reference — Official grammar for SELECT, transactions, and expressions.
- When to use SQLite — The vendor's own list of cases where SQLite is the wrong choice.
- DB Browser for SQLite — Open source GUI client for browsing schemas and running SQL.