Workers Gets Help With State at the Edge

Cloudflare Workers already handles the compute side of serverless application development at the edge — code runs across more than 200 data centers without any configuration. But applications are made of two parts: code and state. Managing state in a globally distributed runtime is trickier than running stateless functions, since distributing data for performance and availability can conflict with consistency guarantees. Cloudflare's own Workers KV offers low-latency global data access, and Durable Objects adds strongly consistent coordination. But some use cases — querying complex datasets, for example, or connecting to an existing system-of-record — don't fit neatly into either product.

To close that gap, Cloudflare is announcing partnerships with two distributed data companies, Macrometa and Fauna, aimed at developers building edge-first applications on Workers. The company is also publishing tutorials for connecting Workers to existing databases that support HTTP connections. Together, the goal is to make Workers a complete platform for both code and state.

Macrometa for Globally Replicated NoSQL Data

Macrometa offers a serverless data platform built around a globally replicated NoSQL database, integrated with search, pub/sub, streams, and stream processing. The Macrometa Global Data Network (GDN) replicates tables across its data centers with configurable consistency, and data calls from Workers are automatically routed to the closest Macrometa region. Macrometa reports that end-to-end latency for a database request from a client to the edge and back is under 75ms at the 99th percentile.

Rather than managing separate systems for different data models, Macrometa presents a single data API over one unified dataset. Developers can access a range of interfaces through a SQL-like query language:

  • Key/value database with high write performance and Time to Live (TTL) support
  • JSON document database with SQL-like querying
  • Graph database for entity relationships
  • DynamoDB API-compatible database
  • Edge cache for database and API results with global invalidation and TTL
  • Search
  • Pub/sub and queues compatible with Kafka, Pulsar, and MQTT
  • Streaming data and complex event processing for real-time evaluation, aggregation, and pattern matching

Workers apps can consume Macrometa through a JavaScript SDK built specifically for Cloudflare Workers, or through the Dynamo client SDK, which lets developers use Macrometa as a drop-in replacement for AWS DynamoDB or as an edge cache.

Reference app: bookstore demo

To demonstrate the integration, Macrometa and Cloudflare rebuilt AWS's demo e-commerce backend for an online bookstore. The serverless app runs as a Cloudflare Worker serving a React single-page application, with Macrometa storing product catalog data, orders, and cart operations. It uses streams and complex event processing for a real-time bestseller leaderboard and the search service for near-instant product results. The company says tests show "orders of magnitude latency improvement" compared to the same use case on a legacy cloud provider. The source code is available on GitHub.

Fauna for Global Transactional Workloads

Fauna takes a different approach: it's a global transactional database exposed as a secure, cloud-based HTTP API. It combines relational and document-centric querying with support for GraphQL and custom business logic, delivered without any database operations required. Because Fauna uses a web-native invocation model with modern security protocols, it avoids the connection limits of traditional databases and integrates directly with serverless functions and applications at the edge.

Fauna complements Workers KV and Durable Objects by providing a queryable, strongly consistent persistence layer for mission-critical data. Its globally distributed storage engine offers transactional guarantees, and the service is available for free at low scale through Fauna's pricing page. Developers can interact with Fauna through GraphQL or drivers for multiple popular languages that work with Workers.

Case study: MeetKai

MeetKai, an AI-powered voice assistant deployed by enterprises with monthly active users in the hundred-million range, uses both Fauna and Cloudflare Workers in production. Workers act as a proxy for all downstream requests, enabling load balancing at the edge. Combined with Fauna, this serverless setup injects personalization data into requests before they hit the backend, delivering scale and performance at predictable costs. More technical detail is available in a case study from Fauna.

Connecting Workers to Existing Databases

Beyond the new partnerships, Cloudflare notes that Workers can work with any database that accepts HTTP connections. The company has documented templates for connecting Workers to both DynamoDB and AWS Aurora, which support Postgres or MySQL. These templates make it easier to build new applications on top of existing data stores. Additional tutorials for other HTTP-accessible databases, such as Google's Cloud Firestore, are planned.

Cloudflare's database strategy now spans three tiers: its own Durable Objects and Workers KV, partner databases like Macrometa and Fauna, and connections to existing providers. The company is soliciting feedback from developers on which databases and features to support next.