What Is SQLite?
SQLite is a serverless, self-contained, transactional SQL database engine — the entire database, and the engine that reads and writes it, lives inside your application as a library, with the whole database stored in a single ordinary file on disk. There's no separate database server to install, start, stop, or manage, no host or port to connect to, and no network round-trip between your code and the data. Your application links against SQLite (or it's already built into the platform, as it is on Android and iOS) and talks to the database directly, in-process.
Serverless, In the Literal Sense
"Serverless" here doesn't mean cloud functions — it means exactly what it says: there is no
SQLite server process running anywhere. Compare that to MySQL, PostgreSQL, or SQL Server, where
you install and run a separate mysqld/postgres process, open a network
connection to it (even if that connection is to localhost), authenticate, and send
queries over that connection. With SQLite, opening a database is just opening a file:
-- Conceptually, "connecting" to SQLite is just opening a file path.
-- No server, no host, no port, no username/password to authenticate a connection.
SELECT 'recipebox.db' AS the_entire_database;
That single file is the database — every table, every index, every row lives inside it. Copy the file and you've copied the whole database (as later lessons cover, there's a right way to do this safely while the app is running).
Where SQLite Actually Runs
| Environment | How SQLite is used there |
|---|---|
| Mobile apps | The built-in, on-device database for both Android and iOS — nearly every app that stores structured data locally is using SQLite under the hood, often through a higher-level library like Android's Room |
| Web browsers | Chrome, Firefox, and Safari all embed SQLite internally for things like history, bookmarks, and IndexedDB storage |
| Desktop applications | Countless desktop apps use SQLite as their local data store instead of asking users to install and run a database server |
| Embedded systems | Devices with limited resources — routers, appliances, in-car systems — use SQLite because it needs no separate server process or admin overhead |
| Application file formats | Some apps' own "file format" is literally a SQLite database file with a custom extension, since SQLite already provides structured storage, transactions, and querying for free |
SQLite vs. a Client-Server Database Like MySQL
It helps to be precise about the difference, since the rest of this track will occasionally point back to it. With MySQL, "the database" and "the server process" are two different things that happen to usually run on the same machine during development. With SQLite, there is no server process at all — the database file and the engine reading/writing it exist only inside whatever process opened the file.
| MySQL (client-server) | SQLite (embedded) | |
|---|---|---|
| Install a server? | Yes — mysqld must be installed and running | No separate server process exists |
| How you connect | Over a network socket, even to localhost, with a username/password | By opening a file path directly, in-process |
| Where data lives | Managed internally by the server across its own files/directories | One single file (or :memory:) that you can see and copy |
| Multiple simultaneous apps | Designed for many clients connecting over the network at once | Best suited to one application (or a small number of local processes) accessing the file |
One of the Most Widely Deployed Pieces of Software in the World
Because it's baked into Android, iOS, and every major browser, SQLite ships on a genuinely staggering number of devices — it's routinely cited as one of the most widely deployed pieces of software on the planet, likely present on every smartphone and most desktop computers in use today. You don't have to take that on faith; by the end of the next lesson you'll have it running and queryable on your own machine in under a minute.
sqlite3 command-line tool running and open your first database file.