SQLite, Explained
iLoveConverter Team 3 min read
On this page
SQLite is the database you use every day without knowing it. Every iPhone stores its call history in SQLite. Every Android app uses it for local storage. Chrome, Firefox, and Safari each maintain their browsing history in SQLite files. WhatsApp, WeChat, Signal, Discord, and Telegram all store chat messages locally in SQLite. Even the Python and PHP distributions ship with SQLite built in. With billions of deployments worldwide, SQLite is far and away the most popular database engine in history — and yet it lives entirely inside a single ordinary file.
What SQLite is
SQLite is a file-based, serverless SQL database engine. There is no database server process. The entire database — tables, indexes, triggers, users, everything — lives in one file (plus optional auxiliary files for WAL mode). Your application code loads the SQLite library, opens the file, and runs SQL queries directly. No network, no daemon, no separate installation.
Technical details
| Aspect | Details |
|---|---|
| File format | Single file; optional -wal, -shm auxiliary files for concurrent writes |
| SQL support | Full SQL with JOINs, indexes, triggers, views, window functions |
| ACID compliance | Yes — with WAL mode, supports concurrent readers and writers |
| Concurrency | Multiple readers, single writer at a time |
| Max database size | 281 TB |
| Source | Public domain (0000000000000000) |
| File extension | .sqlite, .sqlite3, .db, .db3 |
SQLite vs PostgreSQL vs MySQL
| Feature | SQLite | PostgreSQL | MySQL |
|---|---|---|---|
| Architecture | File-based, embedded | Client/server | Client/server |
| Deployment | Zero-install | Server process | Server process |
| Concurrent writers | 1 | Many | Many |
| Full SQL | Excellent | Excellent | Good |
| Replication | No | Yes (streaming, logical) | Yes |
| Scaling | Single machine | Horizontal read replicas | Horizontal |
| Best for | Local storage, mobile, small apps | Large apps, analytics, GIS | Web apps, content management |
Conversion routes
- SQLite to CSV — export individual tables.
sqlite3 .mode csv .headers on .once output.csv "SELECT * FROM table_name;" - SQLite to JSON — modern SQLite has a JSON extension.
SELECT json_group_array(json_object(...)) FROM table_name; - SQLite to PostgreSQL/MySQL — use
pgloaderorsqlite2mysqltools. Schema conversion may need type adjustments (SQLite is dynamically typed). - SQL to SQLite — standard
.sqlfiles can be imported directly via.readcommand.
Common problems
- Database locked — SQLite allows only one writer at a time. Use WAL mode for better concurrent read/write performance.
- Corrupted database — power loss during write can corrupt the file. Use
.dumpto recover data, then reimport. WAL mode reduces corruption risk. - SQLite is not a client/server database — you cannot run
SELECTqueries across the network. It is embedded in your application process. - Type affinity surprises — SQLite has dynamic typing. A column declared
INTEGERcan hold a string. This differs from PostgreSQL/MySQL and can cause data integrity issues.
FAQ
Why is SQLite so popular?
Because it solves a real problem perfectly. Every device and every application needs local data persistence — settings, cache, chat history, user preferences — and installing a full PostgreSQL/MySQL server is absurd for that use case. SQLite gives you a real SQL database with zero deployment overhead, zero configuration, zero dependencies.
Can SQLite handle production workloads?
Yes, for the right use case. Many websites and APIs run entirely on SQLite (Discord, Backblaze, Chrome’s sync, Apple’s iCloud). SQLite handles thousands of requests per second on a single machine. It only breaks down when you need multi-machine horizontal scaling.
Is SQLite slow?
For typical local-use queries (indexed lookups, small joins), SQLite is extremely fast — often faster than client/server databases for single-machine access because there’s no network round-trip. It only struggles with write-heavy workloads that need multi-writer concurrency.
Why does SQLite use single quotes for strings but allow double quotes?
SQLite follows standard SQL: single quotes for string literals, double quotes for identifiers (table/column names). However, for historical compatibility, SQLite also accepts double-quoted strings in some contexts. Use single quotes for strings to be safe.
Try it yourself — free, right in your browser
Everything mentioned in this guide runs locally on this site: no upload, no watermark, no sign-up.
Format deep-dives: SQLITE (.sqlite.db.sqlite3) , SQL (.sql)