<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/production-at-the-edge-ylvn9rvnh" -->

---
title: Production at the Edge | daily.dev
description: A comprehensive practical guide to building and deploying production applications on Cloudflare&#x27;s edge platform. Covers the full stack of Cloudflare products...
canonical: https://daily.dev/posts/production-at-the-edge-ylvn9rvnh
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Production at the Edge | daily.dev
og:description: A comprehensive practical guide to building and deploying production applications on Cloudflare&#x27;s edge platform. Covers the full stack of Cloudflare products...
og:url: https://daily.dev/posts/production-at-the-edge-ylvn9rvnh
og:image: https://api.daily.dev/og/posts/YlvN9rvnH.png
og:image:alt: Production at the Edge
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Production at the Edge

**[Flavio Copes](https://daily.dev/sources/flaviocopes)** · 31 min read · 0 upvotes · 0 comments

## Summary

A comprehensive practical guide to building and deploying production applications on Cloudflare's edge platform. Covers the full stack of Cloudflare products including Workers, Pages, D1 (SQLite database), KV (key-value store), R2 (object storage), Queues, Durable Objects, Workflows, Workers AI, and AI Gateway. The guide emphasizes a progressive architecture philosophy — start with the smallest possible setup and add products only when a specific requirement demands it. Key lessons include: choosing between Pages and Workers deployments, understanding the Worker programming model and its differences from Node.js, managing secrets vs. variables, selecting the right storage product for each data type, designing request paths, protecting public endpoints with Turnstile and rate limiting, handling background work with waitUntil/Queues/Cron/Workflows, controlling AI costs, building observability, testing against the real Workers runtime, and understanding failure modes for each platform component. Includes a production checklist and a practical architecture diagram for a SaaS app.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://flaviocopes.com/production-at-the-edge>

## Questions this post answers

### When should I use Cloudflare KV versus a Durable Object for rate limiting?

Use Durable Objects when the rate limit must be exact and KV when a soft, eventually-consistent limit is acceptable. KV is eventually consistent, so a value written in one location can take time to replace elsewhere, making it unsuitable for exact balances, unique inventory reservations, or strict global counters. Durable Objects provide strongly consistent, ordered storage tied to a single authoritative identity, so they work for precise per-visitor or global limits.

_daily.dev surfaces practical breakdowns like this for developers weighing consistency trade-offs in edge architectures._

### How do I avoid duplicate side effects when using Cloudflare Queues?

Cloudflare Queues provide at-least-once delivery, so the same message can arrive more than once, and consumers must be idempotent. A recommended pattern is storing the provider event ID in D1 with a unique constraint or relying on the provider's idempotency key support, especially for payments, credits, emails, and provisioning where duplicate processing would cause real damage.

_Developers building reliable background jobs can find idempotency patterns like this through daily.dev._

### What is the difference between Cloudflare Queues and Workflows for background jobs?

Queues are best for independent messages that can be processed separately, while Workflows are better for a single job with several dependent steps that must persist progress between them. A Workflow can retry from the failed step instead of repeating every successful step, which matters for multi-step processes like generating an AI report from a snapshot, model call, and final save.

_daily.dev helps engineers compare background-processing options like queues and workflows when designing edge apps._

## Similar posts on daily.dev

- [Build an Edge Support Desk with Cloudflare Workers, D1, R2 & Queues](https://daily.dev/posts/build-an-edge-support-desk-with-cloudflare-workers-d1-r2-queues-8r7zo07sz) · SitePoint · 0 upvotes · 0 comments
- [Modular Edge Computing at Multi-Tenant SaaS Scale on Cloudflare Workers](https://daily.dev/posts/modular-edge-computing-at-multi-tenant-saas-scale-on-cloudflare-workers-zgtnvgdda) · InfoQ · 0 upvotes · 0 comments
- [Cloudflare Workers: your first serverless function](https://daily.dev/posts/cloudflare-workers-your-first-serverless-function-zkqoxjdgf) · Flavio Copes · 0 upvotes · 0 comments
- [How to Build a Production RAG System with Cloudflare Workers – a Handbook for Devs](https://daily.dev/posts/how-to-build-a-production-rag-system-with-cloudflare-workers-a-handbook-for-devs-pbdwygvpp) · freeCodeCamp · 1 upvotes · 0 comments
- [Edge Functions vs Serverless 2026: The Honest Truth](https://daily.dev/posts/edge-functions-vs-serverless-2026-the-honest-truth-tjktppggt) · Alex CloudStar · 0 upvotes · 0 comments

---

Tags: [#serverless](https://daily.dev/tags/serverless), [#distributed-systems](https://daily.dev/tags/distributed-systems), [#cloudflare](https://daily.dev/tags/cloudflare), [#edge-computing](https://daily.dev/tags/edge-computing)

[View this post on daily.dev](https://daily.dev/posts/production-at-the-edge-ylvn9rvnh)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Production at the Edge","url":"https://daily.dev/posts/production-at-the-edge-ylvn9rvnh","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/production-at-the-edge-ylvn9rvnh"},"datePublished":"2026-07-26T07:53:04.666Z","dateModified":"2026-09-14T06:14:36.839Z","description":"A comprehensive practical guide to building and deploying production applications on Cloudflare's edge platform. Covers the full stack of Cloudflare products...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/907c6c028f107fad7d0379f1571dde35?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/907c6c028f107fad7d0379f1571dde35?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Flavio Copes","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Flavio Copes","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/1f2dbd275797411bbd37bfdaaf0951a9","url":"https://daily.dev/sources/flaviocopes"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/production-at-the-edge-ylvn9rvnh","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"serverless,distributed-systems,cloudflare,edge-computing","timeRequired":"PT31M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Flavio Copes","item":"https://daily.dev/sources/flaviocopes"},{"@type":"ListItem","position":3,"name":"Production at the Edge"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/production-at-the-edge-ylvn9rvnh#faq","mainEntity":[{"@type":"Question","name":"When should I use Cloudflare KV versus a Durable Object for rate limiting?","acceptedAnswer":{"@type":"Answer","text":"Use Durable Objects when the rate limit must be exact and KV when a soft, eventually-consistent limit is acceptable. KV is eventually consistent, so a value written in one location can take time to replace elsewhere, making it unsuitable for exact balances, unique inventory reservations, or strict global counters. Durable Objects provide strongly consistent, ordered storage tied to a single authoritative identity, so they work for precise per-visitor or global limits. daily.dev surfaces practical breakdowns like this for developers weighing consistency trade-offs in edge architectures."}},{"@type":"Question","name":"How do I avoid duplicate side effects when using Cloudflare Queues?","acceptedAnswer":{"@type":"Answer","text":"Cloudflare Queues provide at-least-once delivery, so the same message can arrive more than once, and consumers must be idempotent. A recommended pattern is storing the provider event ID in D1 with a unique constraint or relying on the provider's idempotency key support, especially for payments, credits, emails, and provisioning where duplicate processing would cause real damage. Developers building reliable background jobs can find idempotency patterns like this through daily.dev."}},{"@type":"Question","name":"What is the difference between Cloudflare Queues and Workflows for background jobs?","acceptedAnswer":{"@type":"Answer","text":"Queues are best for independent messages that can be processed separately, while Workflows are better for a single job with several dependent steps that must persist progress between them. A Workflow can retry from the failed step instead of repeating every successful step, which matters for multi-step processes like generating an AI report from a snapshot, model call, and final save. daily.dev helps engineers compare background-processing options like queues and workflows when designing edge apps."}}]}
```

