D1

The easiest way to add SQL to your application

D1 is built into the Cloudflare Workers Platform with out-of-the-box integration with Workers. Applications need to save data. SQLite offers a familiar, relational database with SQL querying.

Familiar SQL at the Edge

Build applications with the power and familiarity of a relational, SQL-based database that lives on the edge, close to your users. Leverage your existing SQL knowledge to query structured data with low latency, without having to learn a new query language.

Native Worker Integration

Query your database with near-zero latency directly from your serverless functions, as D1 is built to be the stateful backend for the Cloudflare Workers ecosystem.

Scale for Vibe-Coding Platforms

Create millions of D1 databases, per account or per user, and scale out your vibe-coding platform to support everyone. Pay only when databases are used.

Built for Data-Driven Applications

Background Pattern

Global Read Replication

Automatically create read-only copies of your database across Cloudflare's global network, allowing you to serve data from a location near your users for incredibly fast read performance.

Background Pattern

Native Worker Integration

Query your database with near-zero latency directly from your serverless functions, as D1 is built to be the stateful backend for the Cloudflare Workers ecosystem.

Background Pattern

Modern ORM Support

Develop faster and with full type-safety by using your favorite Object-Relational Mappers, with first-class support for popular tools like Prisma and Drizzle ORM.