The Cloudflare Guide
By Flavio Copes
Learn the Cloudflare developer platform: Workers, KV, D1, R2, Queues, Durable Objects and more, through my hands-on tutorial series.
Cloudflare grew from a CDN into a full developer platform. You can run code, store data, queue jobs, and serve entire sites, all on their edge network.
I moved this site to Cloudflare and ended up learning the whole platform. Then I wrote a tutorial series covering every major piece, one post at a time.
This page is your map through that series and the posts that came after it.
Where to start
The core of the platform is Workers. Follow this path in order:
- Cloudflare Workers: your first serverless function gets you running code at the edge
- Wrangler: the Cloudflare Workers command line tool is the CLI you’ll use for everything
- Serving a website with Cloudflare Workers static assets turns a Worker into a full site
- Cloudflare Workers: secrets and environments covers configuration the right way
- Cloudflare Workers observability: logs and traces shows you what’s happening in production
Storing data
Cloudflare gives you several storage options. Each solves a different problem:
- Cloudflare KV: a key-value store for your Workers for fast, simple reads
- Cloudflare D1: a SQL database for your Workers when you need a real database
- Cloudflare R2: object storage without egress fees for files and assets
- Cloudflare Durable Objects: state that lives in one place for coordination and consistency
- Cloudflare Analytics Engine: store and query metrics for time-series data
Background work and scheduling
Not everything happens in a request:
- Cloudflare Queues: run work in the background
- Cloudflare Cron Triggers: run a Worker on a schedule
- How to rebuild a Cloudflare site on a schedule
- Cloudflare Email Workers: run code when an email arrives
Real-world patterns
Practical things I built on the platform, with the full code:
- Cloudflare Turnstile: stop bots without annoying CAPTCHAs
- Rate limiting with Cloudflare KV
- HMAC-signed URLs on Cloudflare Workers
- Transactional email from Workers with Resend
- Workers Cache: a cache in front of your Cloudflare Worker
- How the Cloudflare Pages build cache works
Go deeper
The best way to learn this platform is to work through the series above, in order. Each post builds something small and real. Start with your first Worker and go from there.
All Cloudflare posts are on the cloudflare tag page.
Related posts about cloudflare: