Cloudflare's system design
☰
Cloudflare is one data center copied into 335+ cities — each answers for the same addresses and every server runs every service — steered by a small control plane that pushes configuration everywhere in seconds.
+ The whole system in one paragraph− Hide
Every Cloudflare data center announces the same IP addresses, so the internet brings each visitor to the nearest of 335+ cities. There, every server runs every service: firewall, cache, customer code. A small control plane copies each settings change to every server within seconds. That speed is also the risk: a bad file in 2025 reached every server at once.
In this lesson
2 chapters · ~9 min · a quick check in eachEverything is on this page — just scroll down ↓
The whole system
Every city, the same data center
One Cloudflare data center — all 335+ are the same. A request runs left to right through every layer on one server; settings flow down from a small control plane on top.
Every data center announces the same IP addresses, so internet routing takes you to the nearest of 335+ cities.
What happens when you open a site behind Cloudflare
The request everyone makes. Almost all of it — WAF rules and a bot score included — happens in the nearest city; the site's own server only hears about you on a cache miss.
10 steps. Follow the flow one step at a time — what happens first, and what comes next.
From one click to every server, in seconds
A setting is written once in the core as the next entry of a numbered log, then copied to every server's disk, where requests read it in microseconds — no trip to the core.
6 steps. Follow the flow one step at a time — what happens first, and what comes next.
Curious? Go deeper+ 5 optional
The cache: one pool per city, tiers, and purge
Every hit is a request the customer's server never sees. On a miss a city asks an upper-tier city before the origin; a purge empties every city in under 150 ms at the median (2024).
Your request can land on any server in the city — the router and Unimog spread connections — and the cache proxy there handles it.
DNS, both sides: Cloudflare's nameservers and 1.1.1.1
DNS turns a name into an address. Cloudflare plays both sides: it answers for its customers' domains and, as 1.1.1.1, looks up any domain for anyone — ~67M queries a second (2025).
A customer adds a record for shop.com in the dashboard or the API. It's saved in Cloudflare's central DNS database, on PostgreSQL: about 1.7 billion records in 2024.
Zero Trust: the office network, without the VPN
A company's employee traffic, without a VPN: the laptop tunnels to the nearest city, where Gateway filters it and Access checks who you are before you reach a private app.
The laptop runs the Cloudflare One Client (formerly WARP). It sends the device's traffic, and its DNS over HTTPS, through an encrypted tunnel — WireGuard or MASQUE, two tunnel protocols — to the nearest Cloudflare city.
The developer platform: code and data on the same network
Customer code runs as a Worker — a V8 isolate — on the server nearest the user, next to three stores: KV for reads everywhere, Durable Objects for one truth, R2 for files.
A request reaches the nearest city, and the runtime on that server runs your Worker — a V8 isolate, not a container. In 2018 one started in about 5 ms.
Why isolates, not containers
Every server runs every customer's code, so each copy must be tiny and start at once. In 2018 an isolate needed ~3 MB and ~5 ms; a Lambda function, 35 MB and up to seconds cold.
ⓘ Details & sources− Hide details
Cloudflare's 2018 numbers: isolates share one engine, so each new one costs megabytes and milliseconds.[10]
Cloudflare averages 115M HTTP requests a second. Roughly how many is that in one day (86,400 seconds)?
Pick one — or just keep scrolling, it's not graded.
Keep going — it's free
Create your free account to unlock the rest of Cloudflare's system design, keep your progress and pick up right where you left off.
- 2Growth & failures
Ask anything about this system, or share how you'd design it.
Log in to join the conversation