Explainers
Chapters

Cloudflare / 00

Cloudflare,
in pieces.

Cloudflare runs a network between visitors and websites, and a set of building blocks for running whole applications on it. Each chapter of this guide is an instrument: you send the request, change the data, or break the consumer, and watch which piece answers.

5 chapters · 7 instruments · 13 services

Illustration Send it again

The first request looks the hostname up, misses the cache, reads photo A from the R2 bucket, and leaves a copy in the cache. The second reuses the DNS answer and is answered by the cache; the bucket is not read. Change the photo in the bucket to B and the cache still answers A, a stale copy, until you purge it. The next request then reads B.

Open the request lab

Four instruments, one at a time

Browse the 13 services

Select a block to read its job, its unit, and its limits. The lines show which blocks a selected one works with, not where they sit or the order a request takes.

DNS · Route and protect
DNS turns a hostname into an address. For a proxied record, it returns Cloudflare addresses so web traffic reaches Cloudflare’s network. DNS-only records send traffic to the origin directly; using Cloudflare DNS alone does not proxy a website. Documentation
Security · Route and protect
Cloudflare’s network provides DDoS protection. The web application firewall (WAF) applies rules to HTTP traffic, allowing, blocking, or challenging requests. Your application still needs its own authentication and permission checks. Available security features depend on configuration and plan. Documentation
CDN cache · Route and protect
A content delivery network (CDN) can keep reusable responses near visitors. An eligible cache hit avoids fetching the content from its source again. A cache can expire or evict data. It is not your permanent storage, and personalized responses need careful cache rules. Documentation
Static Assets · Route and protect
Workers Static Assets serves deployed HTML, CSS, JavaScript, and other site files from Cloudflare’s network. These are files shipped with a deployment. Use object storage for application uploads that change independently. Documentation
Workers · Run your code
A Worker runs your code when a request or another event arrives. It can check permissions, call services, and create a response. Do not keep mutable state in global variables: it is neither shared nor durable. Store important data in a storage service. Documentation
R2 · Keep your data
R2 holds objects: file bytes plus metadata, addressed by a key in a bucket. Think photos, videos, documents, and exports. Object storage does not query rows like a database. A cached copy on a custom domain can stay stale until its TTL ends or it is purged; the bucket itself is not stale. Documentation
Workers KV · Keep your data
KV stores values by key and caches reads around the network. It suits configuration and other data read often but changed less often. Do not use KV alone to coordinate a live counter, reserve a last seat, or require an immediately fresh read after a write. Documentation
D1 · Keep your data
D1 is a managed relational database with SQLite SQL semantics. Tables, indexes, and queries let you work with structured records. D1 answers data queries. Coordinating an active room and its connections is a separate application responsibility. Documentation
Durable Objects · Keep your data
A Durable Object combines code with strongly consistent storage. Requests for the same object identity reach the same logical coordinator. Each object exists once, not as a copy in every location. Its in-memory state can be discarded at any time; its storage survives. Documentation
Queues · Do more work
A producer sends a message. A consumer processes it later, so the original request does not have to wait for that work to finish. A queue does not run your business logic by itself. A consumer does the work; message order is not guaranteed. Documentation
Workflows · Do more work
Workflows runs a multi-step process with persisted progress. Steps can retry, and the process can wait for time or an external event. External side effects still need to be safe to retry. Use Queues to hand off messages; use Workflows to manage a process’s progress. Documentation
Workers AI · Do more work
Workers AI runs supported machine-learning models on Cloudflare-managed GPUs. Your code sends input and receives model output. Model output can be wrong. Your application decides how to validate, store, and use it. Documentation
Vectorize · Do more work
Vectorize indexes numerical vectors, often embeddings of text or images, and retrieves nearby vectors for similarity search. Vectorize searches vectors; an embedding model creates them. It does not generate an answer or replace your source documents. Documentation

Sources and limits

Cloudflare pages used on this page

Documented, illustrated, and observed

Left out on purpose