Cloudflare as a Deployment Platform: Why It Is Not "Just a CDN"

Cloudflare as a Deployment Platform: Why It Is Not "Just a CDN"

OUR GUIDES

Ready to learn?

MarfCode · April 10, 2026 ·
Cloudflare edge computing deployment serverless performance

Cloudflare is still perceived by many as “that thing you put in front of the site to make it faster.” This perception has become obsolete. In 2026, Cloudflare is a complete distributed compute platform — with frontend hosting, serverless backend, databases, storage, authentication, and integrated security — that directly competes with AWS, Vercel, and Netlify on all fronts that matter for an SME.


The Edge Infrastructure: What It Means in Practice

The central idea of Cloudflare as a compute platform is not trivial: instead of running code in one or a few centralized data centers, Cloudflare runs code in its over 300 points of presence (PoPs) distributed globally. Your code runs in the data center closest to the user making the request.

The practical result: a user in Naples visiting a site deployed on Cloudflare Pages receives the response from the data center in Naples or Rome (or Milan), not from a server in Virginia or Ireland. Latency drops from 100–200ms to 10–30ms. Time to First Byte (TTFB) improves by an order of magnitude compared to traditional hosting.

This is not a marginal advantage: for Core Web Vitals and SEO, every millisecond counts.


Cloudflare Pages: Frontend Deployment

Cloudflare Pages is the hosting platform for static frontends and SSR. It connects to the Git repository (GitHub, GitLab), automatically detects the framework (Astro, SvelteKit, Next.js, Nuxt, and many others), and builds and deploys on every push.

Key Features

Atomic deployments: every deployment is immutable. If something goes wrong, you return to the previous version with one click — without restoring backups, without downtime.

Preview deployments: every branch or pull request automatically receives a preview URL. The customer can review the changes in an environment identical to production before merging. This completely changes the review and approval process.

Build cache: Cloudflare Pages caches dependencies between builds. A medium-complexity Astro site that required 3 minutes to build drops to 45–60 seconds from the second build onwards.

Edge rendering: SvelteKit and Astro in SSR mode run directly on Cloudflare Workers — no “server” to manage, no problematic cold starts, automatic scaling to zero under traffic and infinite under peaks.

Generous free plan: 500 builds/month, unlimited deployments, unlimited bandwidth. For almost all SME projects, the free plan is sufficient. The Pro plan at $20/month adds concurrent builds and advanced analytics.


Cloudflare Workers: The Edge Backend

Cloudflare Workers is Cloudflare’s serverless runtime. It runs JavaScript/TypeScript (and WebAssembly) directly on the edge, without containers, without servers, without significant cold starts.

It is the place where APIs built with Hono run — the framework we use for the edge backend. The Hono + Workers combination produces APIs with end-to-end latency in the range of 10–30ms globally, with no infrastructure to manage.

What You Can Do with Workers

APIs and microservices: REST or GraphQL endpoints that process requests, validate data, interact with databases and storage. The pricing model is per request (the first 100,000 per day are free) — unlike a server that costs even when it does nothing.

Middleware and transformations: intercept requests before they reach the origin, modify headers, do A/B testing, conditional redirects based on geolocation or other parameters.

Authentication and authorization: Workers can verify JWT tokens, manage sessions, protect endpoints — all at the edge level, even before the request reaches the application backend.

Scheduled tasks (Cron Triggers): execute code at defined times — send reminder emails, synchronize data, generate reports. Without an always-on server.


Cloudflare R2: Storage Without Egress Costs

Cloudflare R2 is compatible with the AWS S3 API (transparent migration), but with a significant economic difference: no egress costs — transferring data out of R2 to the Internet is free.

On AWS S3, outbound data transfer costs $0.09/GB. For a site with many images or assets, these costs accumulate quickly. R2 eliminates this cost item: you only pay for storage ($0.015/GB/month) and operations.

For projects with abundant media and images, R2 as storage for Directus (which natively supports it) is the optimal economic choice.


Cloudflare D1: SQLite Database on the Edge

D1 is Cloudflare’s serverless relational database — distributed and replicated SQLite on the edge. It is not intended to replace PostgreSQL on enterprise applications: it is intended for data that must be read with minimum latency from anywhere in the world.

Typical use cases: application configurations, user sessions, profile data, read-heavy product catalog. For these patterns, D1 offers performance that a centralized database cannot replicate.


The Integrated Ecosystem: The Real Advantage

The real advantage of Cloudflare as a platform is not the single product: it’s the integration. DNS, CDN, WAF (Web Application Firewall), DDoS protection, compute (Workers), hosting (Pages), storage (R2), database (D1), analytics — everything configured from a single interface, with a single API, without having to orchestrate different providers.

For an SME, this means:

Less operational complexity: one panel instead of five. One account instead of four. One invoice instead of six.

Security by default: WAF, DDoS protection, automatic SSL/TLS, Bot management are included and active by default — they are not options to add and configure separately.

Predictable pricing: no bandwidth surprises at the end of the month. Cloudflare does not charge for outbound traffic like AWS.


What Cloudflare Does Not (Yet) Do Well

It must be said clearly: Cloudflare is not the right answer for every scenario.

Complex relational databases: D1 is SQLite, not PostgreSQL. For applications with complex queries, heavy transactions, or high write volumes, a dedicated database (Supabase, PlanetScale, Railway with PostgreSQL) is the most appropriate choice.

CPU-intensive computing: Workers has CPU time limits per execution (50ms on the free plan, up to 30 seconds on the paid plan). Image processing, complex PDF generation, video encoding: not suitable for Workers.

Complex stateful applications: the serverless model of Workers is stateless by design. Applications that require persistent connections (long WebSockets, audio/video streaming) require specific architectural solutions (Durable Objects) or hybrid approaches.


Our Approach

At Marfcode, Cloudflare is the default deployment platform for all frontend projects (Astro, SvelteKit) and for API backends built with Hono. For backends requiring complex Python logic (FastAPI) or heavy relational databases, we operate on VPS or containers — but the edge layer remains Cloudflare.

The goal is not to use Cloudflare for everything: it is to use Cloudflare for what it does best, and choose the right tool for the rest.

Let’s talk about the right architecture for your project


Related article: Hono vs Fastify vs FastAPI: how to choose the backend framework | Astro and Directus: high-performance headless architecture