Live
Vercel expands AI Gateway inference tools for coding agentsGitHub Copilot expands public‑preview connectors for DevOps and collaboration toolsworkerd clustering enables self‑hosted Cloudflare Workers and Durable ObjectsConsolidating State Health Agency Workflows with Gemini Agent SkillsAI agent database load: patterns, pitfalls, and ScyllaDB mitigationsAI agents for healthcare: deployment patterns and operational impact for cloud and DevOps teamsDesigning an Agent‑Ready Platform: Webflow’s Blueprint for Safe AI‑Generated CodeSelf‑service scaling to 5,000 GKE nodes in under five minutesVercel expands AI Gateway inference tools for coding agentsGitHub Copilot expands public‑preview connectors for DevOps and collaboration toolsworkerd clustering enables self‑hosted Cloudflare Workers and Durable ObjectsConsolidating State Health Agency Workflows with Gemini Agent SkillsAI agent database load: patterns, pitfalls, and ScyllaDB mitigationsAI agents for healthcare: deployment patterns and operational impact for cloud and DevOps teamsDesigning an Agent‑Ready Platform: Webflow’s Blueprint for Safe AI‑Generated CodeSelf‑service scaling to 5,000 GKE nodes in under five minutes
Cloudflare

workerd clustering enables self‑hosted Cloudflare Workers and Durable Objects

AI SummaryPowered by AI

The workerd runtime now supports multi‑instance clustering backed by an object‑storage bucket, turning it from a single‑node development tool into a production‑grade self‑hosting platform. This change lets engineers run Workers and Durable Objects on their own infrastructure while preserving state and scaling without a separate consensus layer.

workerd clustering expands the runtime so that several instances can share a common object‑storage bucket and collectively serve Workers and Durable Objects. The shift from a local‑disk, single‑process model to a bucket‑backed cluster means you can place the runtime inside a VPC, Kubernetes pod, or on‑prem server and still retain the stateful guarantees of Cloudflare’s platform.

How bucket‑backed clustering works

Each workerd instance points at an object‑storage bucket that supports conditional writes – for example Cloudflare R2, Amazon S3, or Google Cloud Storage. When a Durable Object is created, its SQLite database is persisted as a file in that bucket. For every object, workerd uses a conditional‑write operation to elect a single leader that owns the write lock. No external consensus service is required; the bucket itself resolves contention.

Any instance can receive a request for any Durable Object. If it is not the current leader, it forwards the request to the leader instance. Adding capacity is as simple as launching another workerd process against the same bucket; the new node will automatically acquire leadership for a subset of objects. If an instance stops or crashes, another instance picks up its objects using the same conditional‑write mechanism, preserving any writes that were already acknowledged.

Architectural and operational implications

  • Deployment flexibility: The runtime can be run directly on a host or packaged in a container, allowing integration with existing CI/CD pipelines and orchestration tools.
  • State management: Durable Object state lives in the bucket rather than local disk, so state survives instance restarts and can be backed up using standard bucket tools.
  • Scaling model: Horizontal scaling is achieved by adding more workerd processes; the bucket automatically balances leadership without manual sharding.
  • Configuration continuity: workerd now reads wrangler.json and wrangler.jsonc files directly, so existing Workers projects that rely only on supported keys run unchanged on the self‑hosted platform.

Security and reliability considerations

The bucket becomes the single source of truth for both data and leader election, so its access controls are critical. Practitioners must ensure that only authorized workerd instances have write permissions with conditional‑write capability. Because there is no separate consensus service, the security posture of the bucket directly influences the durability guarantees of Durable Objects.

Failure handling relies on the bucket’s consistency model. If the bucket experiences eventual consistency or write‑conflict anomalies, leadership handoff could be delayed, potentially increasing request latency. Monitoring bucket health and latency therefore becomes part of the operational checklist.

Related CloudNinjas coverage: hands-on guides.

What This Means For Practitioners

Adopt workerd clustering when you need to run Workers or Durable Objects inside a controlled network boundary or when data residency requires on‑prem storage. Verify that your chosen bucket provider offers strong conditional‑write guarantees and configure IAM policies to restrict access to the workerd fleet. Update your CI pipelines to launch additional workerd instances as load grows, and instrument metrics around leader election latency and bucket operation success rates. Keep an eye on the upcoming support for worker.config.json and the documented limitations page, as those will affect migration paths and feature parity.

Originally published atCloudflare Developer Platform