iLoveConverter
Categories 11 categories
Data Database

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

AspectDetails
File formatSingle file; optional -wal, -shm auxiliary files for concurrent writes
SQL supportFull SQL with JOINs, indexes, triggers, views, window functions
ACID complianceYes — with WAL mode, supports concurrent readers and writers
ConcurrencyMultiple readers, single writer at a time
Max database size281 TB
SourcePublic domain (0000000000000000)
File extension.sqlite, .sqlite3, .db, .db3

SQLite vs PostgreSQL vs MySQL

FeatureSQLitePostgreSQLMySQL
ArchitectureFile-based, embeddedClient/serverClient/server
DeploymentZero-installServer processServer process
Concurrent writers1ManyMany
Full SQLExcellentExcellentGood
ReplicationNoYes (streaming, logical)Yes
ScalingSingle machineHorizontal read replicasHorizontal
Best forLocal storage, mobile, small appsLarge apps, analytics, GISWeb 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 pgloader or sqlite2mysql tools. Schema conversion may need type adjustments (SQLite is dynamically typed).
  • SQL to SQLite — standard .sql files can be imported directly via .read command.

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 .dump to recover data, then reimport. WAL mode reduces corruption risk.
  • SQLite is not a client/server database — you cannot run SELECT queries across the network. It is embedded in your application process.
  • Type affinity surprises — SQLite has dynamic typing. A column declared INTEGER can hold a string. This differs from PostgreSQL/MySQL and can cause data integrity issues.

FAQ

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)