All templates
/
Database
CURATED TEMPLATE / Cloudflare

You want an edge application with a database close to its Worker.

D1 database starter

View original source

When this becomes useful

The first version needs a place to keep data, while later versions need schema changes, access controls and recovery. Use the example to examine those boundaries before copying defaults.

What the template offers

D1 database starter is a Workers starter from Cloudflare Templates. It offers a concrete implementation to inspect and adapt. A compact way to begin with Workers and D1. Add schema migration and data access rules before a multi-tenant app.

Technical shape

Inspect the Worker binding to D1, schema files and migration workflow before adding customer data.

Questions worth answering

  • How will the schema change over time?
  • Where is the tenant boundary enforced?
  • What is the backup and restore plan?

Inspect the source

Read the maintainer's README, license, setup instructions and current repository state before adapting the code.

Open Cloudflare Templates