What is Cloudflare D1 Database?
SQLite at the edge: a relational database replicated near users with SQL semantics developers already know. BYOB DB provisions one per project with schema viewing and SQL inspection.
Example
A SaaS starter gets users, subscriptions, and usage tables in D1; the workspace shows schema and rows live while the app queries through Drizzle types.
What people get wrong
Reaching for Postgres-scale ceremony on day one. D1 covers the vast middle of apps; migrate when measurements — not anxiety — say so.
Related terms
D1 Binding & Proxy Token
How apps reach their database: a Worker binding plus a server-to-server proxy token. Credentials stay in project environment, never in generated files.
Drizzle ORM
A typed TypeScript layer over SQL for schema definition and queries. Types generated from the live schema keep app code and database in agreement.
Database Migration
Versioned SQL changes applied in order, so schema evolves without losing data. Migrations are the contract between yesterday’s database and today’s code.
Cloudflare Worker
Serverless code running on Cloudflare’s edge network, close to visitors worldwide. BYOB deploys generated apps as Workers: no servers to provision, scale, or patch.
Dispatcher Worker
The SaaS router that maps each request — by publish slug or custom domain — to the right per-project Worker. One edge entry point, thousands of isolated apps behind it.
Dispatch Namespace
The isolate group containing a fleet of per-project Workers. Namespaces let one platform deploy, version, and route user projects independently.