SQLite
A complete database in a single file.
SQLite is taught here in 14 lessons, running from The database in a file, and the sqlite3 CLI through to Next steps: choosing SQLite vs a client-server database. Each lesson takes one topic, shows the working code, and links onward to the next, so the course can be read straight through in order.
| Track | Databases |
| Lessons | 14 |
| Level | Beginner to intermediate |
| Reading time | about 3 hours |
| Prerequisites | Helpful, but not required: Redis |
Lessons
- The database in a file, and the sqlite3 CLIOne file, no server, dynamic typing — plus the CLI commands and pragmas that make it usable for real work.
- Using SQLite from application codePrepared statements, transactions in bulk, and the concurrency rules that keep an embedded database from throwing SQLITE_BUSY.
- WAL mode, backups, and when not to use SQLiteWhat the write-ahead log changes, how to take a consistent backup of a live database, and the workloads where another engine is the right answer.
- Data types, affinity, STRICT tables and WITHOUT ROWIDHow type affinity really works, why STRICT tables are worth adopting, rowid versus primary key, and generated columns.
- Querying with SQL: joins, grouping, upserts and CTEsJoins and aggregates in SQLite syntax, ON CONFLICT upserts with RETURNING, CTEs and recursive queries, and window functions.
- Transactions, locking and concurrencyBEGIN IMMEDIATE versus DEFERRED, busy_timeout, one writer at a time, connection per thread, and WAL behaviour under load.
- Indexes, ANALYZE and EXPLAIN QUERY PLANHow the planner chooses, covering and partial and expression indexes, reading a query plan, and keeping statistics fresh.
- Full-text search with FTS5Virtual tables, tokenizers, prefix and phrase queries, bm25 ranking, external-content tables and snippet highlighting.
- JSON, generated columns and date functionsThe built-in JSON functions and JSONB, generated columns over JSON, date and time arithmetic, and the string and math extensions.
- Migrations and schema versioning for embedded appsuser_version as a migration counter, an idempotent runner, safe table rewrites, the limits of ALTER TABLE, and data migrations.
- SQLite on mobile, desktop and in the browserBundling and upgrading on Android and iOS, SQLCipher encryption, desktop packaging, and WASM builds with OPFS persistence.
- LiteFS, libSQL and replication for serverless appsReplication models for an embedded database, LiteFS and its FUSE-based primary, Turso and libSQL, read replicas and consistency trade-offs.
- Testing, tooling and benchmarks for SQLite appsIntegrity checks, dbstat, VACUUM and pragma tuning, in-memory test databases, deterministic testing and honest benchmarking.
- Next steps: choosing SQLite vs a client-server databaseA workload decision guide, hybrid patterns that use both, the operational differences that matter, and a reading path forward.
More in Databases
SQL MySQL PostgreSQL MongoDB Redis
FAQ
How long does the SQLite course take?
It has 14 lessons, about 3 hours of reading. Expect roughly twice that if you type out and run every example.
Do I need prior experience for SQLite?
Not strictly. It helps to have read Redis first, because some lessons build on it, but every lesson explains its own assumptions.
What should I read after SQLite?
This is the last course in Databases right now. Browse the other tracks from the courses index to go sideways.