Cloud

Cloudflare

A global network with CDN, DNS, DDoS protection, plus Workers, R2 and D1 for running apps at the edge.

What it is

Cloudflare started as a CDN and DNS proxy with DDoS protection and is now a full platform. Your domain's traffic passes through its network spread across hundreds of cities, where it is cached, filtered and accelerated.

Beyond the network there is a developer platform: Workers (code at the edge), R2 (S3-compatible storage with no egress fees), D1 (a SQLite database), KV, Queues, Pages.

The free tier is generous, so Cloudflare often sits in front of sites of any size as DNS, CDN and WAF.

Use it when

  • You need CDN, DNS and protection against DDoS and bots for a site.
  • You want to run code close to users with minimal latency (Workers).
  • You serve many files and egress fees in other clouds are costly (R2).
  • You need Zero Trust access to internal apps without a VPN.

Avoid it when

  • You need long-running computation or heavy databases: these are not general-purpose virtual machines.
  • Compliance forbids routing traffic through a third-party proxy.
  • The app relies heavily on Node.js APIs that are not available in the Workers runtime.

Key concepts

Anycast CDN
A request lands on the nearest network node, where a cached copy is served or code runs.
Proxy (orange cloud)
A mode where a DNS record is proxied through Cloudflare: it hides the server IP and enables cache and WAF.
WAF
Web Application Firewall: rules against SQL injection, bots and suspicious requests.
R2
Object storage with an S3-compatible API and zero egress fees.
Tunnel
Cloudflare Tunnel exposes an internal service through an outbound connection, with no open ports.

Example

Cloudflare Tunnel: publishing a local service under a domain.

Interview questions

  1. 1. What does a CDN do and why is it needed?

    A CDN keeps copies of static files on nodes closer to users, so responses arrive faster and the origin has less load. It also absorbs part of DDoS traffic.

  2. 2. How do Workers differ from AWS Lambda?

    Workers run on V8 isolates at the network edge and start with almost no cold start. Lambda runs a containerized environment in one region but supports more languages and longer executions.

  3. 3. Why is R2 interesting compared with S3?

    It is compatible with the S3 API but charges no egress fees. For projects that serve many files this can cut the bill a lot.

Interview questions from the bank

Logos belong to their owners and are used for identification only. Icons: Simple Icons (CC0), Devicon (MIT).