Durable Actors: Open-Source Alternative to Cloudflare Durable Objects
Durable Actors provides stateful serverless functions for real-time applications
Durable Actors is an open-source alternative to Cloudflare Durable Objects designed to eliminate vendor lock-in and memory limits while providing built-in observability. It enables developers to build real-time applications—such as AI agent swarms, collaborative editors (e.g., Notion), and chat systems (e.g., ChatGPT)—by providing a foundational building block that abstracts away the complexities of persistence, coordination, and infrastructure in distributed systems.
Core Architecture: Durable State and Serialized Execution
At the center of the framework is the "actor," a class that combines two primary guarantees:
- Durable State: Data persists across interruptions, errors, and server restarts. Fields marked with the
@Persisteddecorator are automatically saved by the runtime. - Serialized Execution: Concurrent calls to an actor are executed sequentially. This ensures that multiple callers can update the actor's state safely without race conditions or complex locking mechanisms.
To handle long-running operations without blocking the entire actor, the framework provides an @Interleave decorator. This allows other calls to run while the actor is awaiting a promise, which is critical for streaming responses (e.g., LLM outputs) where new connections must be accepted while a reply is still being generated.
Development Workflow and Integration
Local Development and Deployment
Developers can initialize a project using npx durable-actors init and run a local server via npx durable-actors dev. The runtime loads actors on demand and persists state automatically. For production, the framework supports self-hosting the runtime on Google Cloud Platform (GCP).
Type-Safe Client Generation
To integrate actors into an existing backend, the SDK generates type-safe clients using npx durable-actors generate. This allows backends (e.g., Express.js) to prepare WebSocket connections to specific actors using a unique actorId.
Language Support
The Durable Actors SDK currently supports TypeScript and Python, providing documentation and guides for both languages to ensure a consistent contract between the actor logic and the client application.
Community Perspectives and Technical Trade-offs
While the project has been welcomed as a Cloudflare alternative, community discussions on Hacker News highlight several technical considerations for developers implementing the virtual actor model:
State Queryability
A common challenge with the actor model is the difficulty of querying state across multiple actors. Because state is encapsulated within individual actors, performing global queries often requires duplicating state into a separate queryable database or emitting versioned domain events transactionally alongside state changes.
Performance and Latency
Some users have raised concerns regarding write latency. One commenter noted that 100ms write times may be limiting for high-performance applications, comparing the project to celld, which claims significantly lower write latencies (around 1ms).
Ecosystem Comparisons
Community members have questioned how Durable Actors compares to other durable execution and actor frameworks, including:
- Cloud-native services: Azure Durable Functions, AWS Lambda Durable Functions, and Durable Entities.
- Open-source alternatives:
celldand Rivet.
"Looks great but one of the common problems with the virtual actor model is state query. It's all well and good to have nice separated state dbs but for most use cases that means further double up on storing the state again in another database that can query it."
Summary of Capabilities
| Feature | Implementation |
|---|---|
| State Persistence | @Persisted decorator for automatic field saving |
| Concurrency Control | Serialized execution by default; @Interleave for async concurrency |
| Client Access | Auto-generated type-safe clients for Python and TypeScript |
| Deployment | Local development and self-hosting on GCP |
| Observability | Built-in monitoring and debugging tools |
Sources
Related
- Project
- Dispatch
- Project
- Dispatch
- Dispatch