SQLite Explained: The Database That Lives Inside Your App

Introduction

Most databases (MySQL, PostgreSQL — both covered earlier) are servers: a separate program your app connects to over a network. SQLite, created by D. Richard Hipp in 2000, is the opposite: a complete relational database engine compiled into a library your app links directly, storing the entire database in a single file on disk. No server to install, no configuration, no network — which is why SQLite is, by most estimates, the most widely deployed database engine in the world: it lives in every Android and iPhone, every browser, and countless apps you use daily.

A database in a single file

Using SQLite feels like using any SQL database, minus the server setup. The same SQL you already know works — creating tables, inserting rows, querying with joins — but the database is just a file you can copy, back up, or email:

CREATE TABLE notes (
  id INTEGER PRIMARY KEY,
  title TEXT,
  body TEXT,
  created_at TEXT
);
INSERT INTO notes (title, body, created_at)
VALUES ('First note', 'SQLite needs no server.', '2026-10-27');
SELECT title FROM notes ORDER BY created_at DESC;

That simplicity is the feature: a small app, a prototype, a mobile app, or a desktop tool gets a real, transactional, ACID database (your writes either fully happen or fully don't) without operating a server. Tools like the sqlite3 command line and the DB Browser let you inspect the file directly, and nearly every language has a built-in or first-party SQLite library — Python ships one in its standard library.

The honest trade

SQLite's trade is scale and concurrency: a single file means one writer at a time (reads can run concurrently), and it is not designed for high-write, multi-user server workloads — that is what MySQL and PostgreSQL are for. It also has a simpler type system than server databases (its famous "flexible typing" can surprise newcomers). The rule of thumb: SQLite for apps, embedded systems, prototypes, local storage, and testing; a server database when many users write concurrently or the data outgrows one machine.

Takeaway

SQLite is a full SQL database in a single file, with no server to run — which is why it is inside nearly every device you own. Learn it, and small apps get a real database for free, with the same SQL you already know.

Comments

Popular posts from this blog

Swift Explained: Apple's Language for iPhone, Mac, and More

Flutter Explained: One Codebase, Every Screen

Go Explained: Simple Code That Runs Fast