Skip to content

Cloudflare-First Architecture

We build on Cloudflare’s primitives (Workers, Durable Objects, R2, D1) rather than traditional cloud infrastructure.

Context

Every software product needs a cloud platform. The choice affects cost structure, developer experience, competitive moat, and operational complexity. We faced three options:

  • Traditional cloud (AWS/GCP/Azure): Mature, flexible, but complex and expensive
  • Edge-native (Cloudflare): Simpler model, better economics, but smaller ecosystem
  • Multi-cloud: Flexibility, but doubled complexity and slower time-to-market

Alternatives Considered

OptionWhy Not Chosen
AWS/GCP/AzureHigher complexity, steeper learning curve, more expensive at our scale, longer lock-in through proprietary services
Multi-cloudDoubles implementation effort, uncertain benefit, delays time-to-market by 2-3x
Self-hostedNot viable for capital constraints, operational burden too high for solo founder

The Decision

Build on Cloudflare Workers, Durable Objects, R2, and D1 as our primary infrastructure.

Why Cloudflare:

  1. Cost structure aligns with usage-based pricing — we pay for what we use, no idle capacity
  2. Global edge deployment by default — every deploy is global, no region selection
  3. Simpler mental model — fewer services to learn, faster velocity
  4. Strong DX with Wrangler — single CLI for everything
  5. Agent-friendly primitives — Durable Objects perfect for stateful agent sessions

What this enables:

  • SmartBoxes can offer global, low-latency sandbox execution
  • Costs scale with revenue, not ahead of it
  • Single developer can operate production infrastructure
  • Competitive moat: few competitors will choose this architecture

Tradeoffs Accepted

What we’re giving up:

  • Smaller ecosystem than AWS/GCP (fewer tutorials, examples, libraries)
  • Less flexibility in compute (no GPUs, limited runtime customisation)
  • Single vendor dependency (Cloudflare is our critical supplier)
  • Some enterprise features less mature (compliance certifications, support tiers)
  • Potential future lock-in as architecture grows more entangled

What we’re accepting:

  • Need to pioneer some patterns ourselves
  • May hit capability gaps that require workarounds
  • Enterprise deals may require compliance answers we don’t have yet

Reversal Triggers

Revisit this decision if:

  • Cloudflare pricing becomes uncompetitive (>2x equivalent AWS costs)
  • Critical capability gap blocks product development (e.g., need GPUs, need specific compliance)
  • Cloudflare reliability issues affect customers (repeated outages, data loss)
  • Enterprise customers require specific cloud compliance we can’t achieve
  • Cloudflare deprecates or degrades key primitives (Durable Objects, etc.)

Early warning signs:

  • Cloudflare quarterly earnings showing pricing pressure
  • Our costs growing faster than revenue
  • Customer requests we can’t fulfil on Cloudflare
  • Competitors winning on “runs on your cloud” positioning

Review Schedule

Next review: 2025-06-01

Review questions:

  1. Are costs within projections?
  2. Have we hit any capability gaps?
  3. Are customers asking for AWS/GCP deployment?
  4. Has competitive landscape changed?

Depends on assumption:

Creates risk:

Affects products:

Uses primitives:

Context

We need to choose a cloud platform to build on. The options are traditional cloud (AWS/GCP/Azure), edge-native (Cloudflare), or multi-cloud.

Decision

Build on Cloudflare Workers, Durable Objects, R2, and D1 as our primary infrastructure.

Rationale

Cloudflare offers (1) cost structure aligned with usage-based pricing, (2) global edge deployment by default, (3) simpler mental model than traditional cloud, (4) strong DX with Wrangler. We accept the risk of smaller ecosystem.

Alternatives Considered

OptionWhy Rejected
AWS/GCP/AzureHigher complexity, longer lock-in, but more mature ecosystem
Multi-cloudHigher complexity, longer time to market, uncertain benefit
Self-hostedNot viable for our scale and capital constraints

Tradeoffs

  • Smaller ecosystem than AWS/GCP
  • Less flexibility in compute (no GPUs, limited runtime)
  • Single vendor dependency
  • Some enterprise features less mature

Reversal Triggers

Revisit this decision if:

  • Cloudflare pricing becomes uncompetitive (over 2x equivalent AWS)
  • Critical capability gap that blocks product development
  • Cloudflare reliability issues affecting customers
  • Enterprise customers require specific cloud compliance

Depends On Assumptions

Affects Products