Databases
SQLite
An embedded serverless database in a single file: the most widely deployed database in the world.
What it is
SQLite is a library, not a server. The database lives in one file and the app works with it directly, with no network or separate process. The code is in the public domain.
It supports full SQL, ACID transactions, indexes, JSON functions and FTS5 for full-text search. WAL mode allows concurrent reads during a write, but only one writer at a time.
SQLite is built into phones, browsers, Electron apps and thousands of programs. Increasingly it is used server-side for small and medium services and in edge variants (Turso, Cloudflare D1).
Use it when
- Mobile and desktop apps, local storage.
- Prototypes, tests, small sites and internal tools.
- A file format for data exchange and single-node analytics.
Avoid it when
- Many concurrent writes from different servers: you need a client-server database.
- Highly available clusters with automatic failover.
Key concepts
- Single file
- The whole database in one portable file.
- WAL mode
- A log that lets readers work alongside a writer.
- Dynamic typing
- The value's type, not the column's, drives storage (type affinity).
- FTS5
- The full-text search module.
Example
Interview questions
1. Why is SQLite called serverless?
There is no separate server process: the app reads and writes the file through a library. No network setup, users or extra service are needed.
2. What are the concurrency limits?
Many readers at once but only one writer. WAL mode and short transactions reduce locking, yet many writers need a different database.
3. How does SQLite's dynamic typing differ from other databases?
The type belongs to the value, so you can store text in an INTEGER column.
STRICTtables enable strict types.
Related technologies
- PostgreSQLA powerful open source relational database with extensions, JSONB, full-text search and strong SQL support.
- MySQLOne of the most widespread relational databases, the foundation of many web projects and the LAMP stack.
- PrismaAn ORM for Node.js and TypeScript with a schema file, a generated type-safe client and migrations.
- React NativeA framework for native mobile apps using React and JavaScript or TypeScript.
Logos belong to their owners and are used for identification only. Icons: Simple Icons (CC0), Devicon (MIT).