SQLite is a SQL database that fits inside a single file. No need to install a server, create users or configure anything: your program opens the file and reads or writes data directly.
That's why it's in phones, browsers and countless apps.
How it works
Most databases, like PostgreSQL, run as a separate service that the app connects to over the network. SQLite is a library embedded in the app itself. All data lives in one file, for example dados.db.
You use SQL normally: create tables, insert rows and query. SQLite handles writing to disk safely, even if the program closes suddenly.
The main limitation is concurrent writes: it allows many reads at the same time, but few parallel writes.
Practical example
You build a bot that stores reminders. In Python, which already includes SQLite support:
import sqlite3
con = sqlite3.connect("lembretes.db")
con.execute("CREATE TABLE IF NOT EXISTS lembretes (id INTEGER PRIMARY KEY, texto TEXT)")
con.execute("INSERT INTO lembretes (texto) VALUES (?)", ("Pagar fornecedor",))
con.commit()
for linha in con.execute("SELECT * FROM lembretes"):
print(linha)Done: you have persistence without installing anything. To back up, just copy the file.
What it's for
It's for small and medium apps, prototypes, command line tools, mobile apps, automated tests and local data for agents. Many code agents store history and memory in SQLite files.
For a system with many users writing at the same time, or with access from multiple servers, a database like PostgreSQL is usually more appropriate.
Difference between SQLite and PostgreSQL
SQLite is simple, local and serverless. PostgreSQL is a full server, with user control, high concurrency and advanced features. Start with SQLite when the project is small and migrate if you need to grow.