Memory
The Memory Driver is a simple in-memory implementation designed for development and testing environments. It stores all actor state in memory, which means data is not persisted between application restarts.
You rarely need to manually configure drivers. The platform package you’re using will configure the appropriate drivers for you. See the documentation for your platform for details.
The Memory Driver is not recommended for production environments as it doesn’t provide persistence or distributed capabilities.
Compatibility
Platforms | Topologies |
---|---|
Node.js | Standalone |
Bun | Partition |
Cloudflare Workers | Coordinate |
Rivet |
Installation
Install the required packages:
Create a simple server using the Memory driver:
Start your server:
Limitations
The Memory driver has several limitations to be aware of:
- No Persistence: All data is stored in memory and lost when the application restarts
- Single Process: Only works within a single process - not suitable for distributed environments
- Scalability: Cannot scale beyond a single instance
- Coordination: Limited support for coordinated topology, as actors can only communicate within the same process
For production environments or applications requiring persistence and distributed capabilities, consider using the Rivet or Cloudflare Workers instead.