Skip to main content
Todas las publicaciones
Engineering

Why Cost Less with Cloudflare

A breakdown of how Cloudflare's edge infrastructure cuts operational costs for web apps.

Cloudflare takes a different approach. Instead of charging for each layer separately, the network itself is the product — and it covers most of what web apps need at a flat rate or no additional cost.

Cloudflare D1 — Serverless SQLite at the Edge

D1 is Cloudflare's serverless SQLite. It replicates globally and bills by storage and queries. For a typical SaaS app, the free tier covers early production. When you grow, pricing scales with actual usage rather than provisioned capacity.

Drizzle ORM sits on top, so the schema migration workflow and query API are standard. You're using SQLite with global distribution.

Cloudflare R2 — Storage Without Egress Fees

Amazon S3 charges for data transferred out. For a media-heavy app, egress can surpass storage costs by a wide margin.

Cloudflare R2 is S3-compatible storage without egress fees. You pay for storage and requests, not for bytes leaving the network. If your app serves a lot of user content, this line item disappears.

Cloudflare KV — Lightweight Server Cache

Many SaaS apps pay for repeated provider calls because every page load asks the same question again: is this email subscribed, what is the public list, what did the remote API return?

Cloudflare KV gives those low-risk reads a lightweight edge cache. In TanStarter, it is an optional layer for cacheable data, not a replacement for the database, auth system, or payment provider.

Cloudflare Email Service — Routing and Sending

Cloudflare Email Service covers both inbound routing and outbound transactional sending.

Email Routing handles incoming email. Set up your domain, add MX records, and mail flows through Cloudflare to your inbox.

Email Sending is for transactional mail — order confirmations, password resets, digests. Pair it with React Email + Resend for rich templating, or use Cloudflare's native SMTP relay for simpler cases.

Cloudflare Workers — The App Platform

Traditional hosting charges per compute instance. A Node.js server on a $20/month VPS sits idle most of the day but costs the same as one at full capacity.

Cloudflare Workers runs your code in a V8 isolate. Cold starts are measured in milliseconds. The free plan allows 100,000 requests per day. Paid plans are $5/month for 10 million requests — no idle time billing.

The TanStack Start template compiles to a single ~2 MB bundle. That fits comfortably on the free tier. For a product in beta or early launch, hosting costs are effectively zero.

Cloudflare Workers AI — AI at the Edge

Workers AI runs inference on hardware Cloudflare already operates at 200+ data centers worldwide. You pay per request, not per compute minute. A text summarization call costs fractions of a cent. Image generation runs a few cents.

For a TanStack Start app, you can wire up AI features without a separate AI budget. The REST API is identical in structure to the rest of your server functions.

One Dashboard, One Bill

Cloudflare consolidates compute (Workers), storage (R2), database (D1), AI (Workers AI), email, and global routing into a single account. One login, one invoice, one place to check when something is wrong.

The actual math

A rough comparison for a typical SaaS app in early production:

Cost centerTraditional setupCloudflare
Compute$20–$50/month (VPS or container)$0–$5/month (Workers)
Database$15–$50/month (managed DB)$0–$5/month (D1)
Storage + egress$10–$30/month (S3 + transfer)$0–$5/month (R2)
AI inference$20–$100/month (GPU API)$0–$10/month (Workers AI)
Email$10–$30/month (SendGrid/Mailgun)$0 (Email Routing)
CDN$10–$50/month (CloudFront/Fastly)Included
Total$65–$310/month$0–$30/month

The exact numbers depend on usage, but the ratio is consistent. Cloudflare's model aligns costs with actual consumption rather than provisioned capacity. For a project scaling from zero to tens of thousands of users, the billing stays close to usage rather than jumping in steps.