SQLite

SQLite

Embedded serverless SQL database engine

Features

  • Zero-configuration, serverless, self-contained
  • Single file database — no separate server process
  • Full SQL support with JSON extensions
  • WAL mode for concurrent read/write access

Pros

  • Zero ops — no server to manage
  • Incredibly fast for read-heavy workloads
  • Perfect for embedded, mobile, and edge applications

Cons

  • Single-writer limitation constrains write throughput
  • No built-in replication or clustering
  • Not suited for high-concurrency write workloads

Overview

SQLite is a self-contained, serverless SQL database engine that stores the entire database in a single file. It’s the most widely deployed database in the world, embedded in every smartphone, browser, and countless applications. Unlike PostgreSQL or MySQL, SQLite requires no separate server process.

SQLite has experienced a renaissance in web development thanks to edge computing platforms. Services like Turso and Cloudflare D1 build on SQLite to provide distributed, low-latency databases at the edge. Bun also includes a native SQLite driver, making it trivial to use in server applications.

When to Use

SQLite is ideal for embedded applications, CLI tools, mobile apps, edge computing, and any workload where simplicity and zero ops matter. With services like Turso, it’s increasingly viable for web applications. Avoid it for high-concurrency write-heavy workloads.

Getting Started

# SQLite comes with most systems, or:
npm install better-sqlite3
import Database from "better-sqlite3";

const db = new Database("app.db");
db.exec(`CREATE TABLE IF NOT EXISTS users (
  id INTEGER PRIMARY KEY,
  name TEXT NOT NULL
)`);

const user = db.prepare("SELECT * FROM users WHERE id = ?").get(1);