Deployment

Cloudflare

Pages, Workers, D1, KV and Durable Objects: the limits, the traps, and the guards that catch them

10 guides in this collection

Data

Bind Your Own D1 and KV: Never Copy an Id

Cloudflare binds D1 and KV by id and never checks the name. A copied id attaches your app to another project's data, and every query succeeds.

3 min read
Deployment

Preview Builds Must Not Migrate Production

Pages runs one build command for every branch. If that command applies migrations, each pull request preview tries to change the live database.

3 min read
Deployment

Free-Tier Budgets: Count Your Writes and Rows

The limits that stop a Cloudflare app are daily counts of KV writes and D1 rows. Keep volatile state out of synced storage, and give every loop a per-run cost.

4 min read
Deployment

A Dev Server Through a Cloudflare Tunnel

Pin the dev port, bind to loopback, allow the tunnel host in Vite, and check the public URL from outside before you say it works.

3 min read
Deployment

Password Hashing on Workers: The PBKDF2 Limit

Workers rejects PBKDF2 above 100,000 iterations. Code that uses more passes every local test and returns a 500 for every sign-in in production.

3 min read
Data

D1 Timestamps: Compare Like With Like

An ISO string from JavaScript and datetime('now') from SQLite are different text formats. Compared directly, an expired session stays valid until the end of the day.

3 min read