Skip to content
CloudInsights

Cloudflare for production apps — what it gives you, and what it doesn't

Edge, security, and deploy — without putting everything in one box.

Cloudflare is more than a CDN. For many Next.js and SaaS products it's edge, DNS, WAF, storage, and compute in one vendor — but you need to know which pieces you actually need.

4 min read
Stylised map of Cloudflare edge connecting DNS, caching, Workers, and storage to a production app.

Cloud & edge

Cloudflare is often what the team already uses for DNS — and then the conversation stops. But the platform has grown into something that can carry full frontend deploy, edge logic, object storage, and DDoS protection for real production apps.

The question isn't whether Cloudflare is "good". It's which parts match your product — and what you still need to put somewhere else.

TL;DR

Key takeaways

  • Cloudflare bundles DNS, CDN, WAF, edge compute, and storage — fewer vendors to coordinate.
  • Pages + Workers can host Next.js and API logic close to the user.
  • R2 and D1 cover many needs without spinning up a separate object store immediately.
  • It doesn't always replace a full Postgres backend or long-running background jobs — plan what lives where.

Which pieces are typically used

Most production setups we see combine DNS and WAF (traffic in), Pages or Workers (app and API at the edge), and R2 for files and assets. D1 or external Postgres for persistent data depends on product requirements.

The upside is latency and a unified security profile: DDoS, bot filtering, and TLS handled in one place. The downside is the learning curve — Cloudflare has many products, and it's easy to pick the wrong abstraction if nobody has deployed Next.js there before.

When Cloudflare — and when something else

Use the matrix when choosing between Cloudflare-first, Vercel, or classic container hosting.

  • Cloudflare-first

    You already have DNS and security on Cloudflare

    Other host / hybrid

    Use Pages/Workers — avoid splitting edge and origin unnecessarily

  • Cloudflare-first

    The product is mostly static/ISR with light edge logic

    Other host / hybrid

    Cloudflare Pages is often right — fast and straightforward to run

  • Cloudflare-first

    You have heavy background jobs, queues, or long-running processes

    Other host / hybrid

    Hybrid: edge on Cloudflare, worker/backend on container or managed service

  • Cloudflare-first

    Next.js features that need Node runtime without constraints

    Other host / hybrid

    Vercel or containers may mean fewer compromises than pure edge

  • Cloudflare-first

    Compliance requires a specific region or isolated database

    Other host / hybrid

    Combine Cloudflare for edge with database hosted to your requirements

WAF, bots, and traffic you don't want

An underrated reason for Cloudflare in production isn't the CDN — it's controlling malicious and noisy traffic before it hits your origin. Rate limits, bot handling, and simple firewall rules spare you from building the same thing in the application.

That doesn't replace app-level auth. It's a filter in front — especially valuable when you expose APIs or login endpoints that otherwise get hammered by scanners.

Before you go Cloudflare-first in production

  • DNS and TLS are in place — or you have a clear cutover plan
  • Next.js dependencies are tested on the runtime you choose (Workers/OpenNext)
  • Persistent data lives somewhere with backup and migrations — not only temporary edge state
  • Secrets and environments are separated for preview and production
  • You know what still needs to run outside the edge (queues, long jobs, private network)

Questions we get over and over

  • Can Next.js run fully on Cloudflare?

    Much of it — via OpenNext and Workers. Some Node-specific packages and runtime assumptions still need testing. We map your dependencies in discovery before we promise a pure edge deploy.

  • How do you choose between Cloudflare and Vercel?

    By your existing setup and ops needs: if you already have DNS/WAF on Cloudflare, that often pulls that way. If you want the tightest Next.js integration and lowest friction on previews, Vercel pulls. We map the profile — not the hype.

  • Should we move DNS first?

    Often yes — DNS on Cloudflare makes the rest simpler. But you can also start with Pages on a subdomain and migrate DNS when you're comfortable. We plan cutover to avoid downtime.

  • What about database — D1 or Postgres?

    D1 fits light edge data and prototypes. Serious SaaS products typically use Postgres (managed on Supabase, Neon, or your own host) with RLS and migrations. The choice follows data model complexity — not hype.

Considering Cloudflare for production?

Let's map which pieces you actually need.

We'll walk through product, traffic, and compliance and propose a setup that holds — without putting everything on edge just because it's possible.

Why we wrote this

This is how we think — and it's what we build.

Our insights are about the work we actually do. If this hit something you're working on, there's a concrete service that lines up.