Development Guide
Adapters
Pluggable infrastructure for state, streams, events, and cron
Adapters let you swap infrastructure implementations without changing your code. Use defaults for single-instance deployments or distributed adapters for scaling.
How It Works
Configure adapters in motia.config.ts. If you don't specify any, Motia uses defaults.
Your Step code stays the same:
Adapter Types
| Type | What it handles | Default | Distributed |
|---|---|---|---|
| State | Key-value storage | File | Redis |
| Streams | Real-time data | File | Redis |
| Events | Event queues | In-memory | RabbitMQ |
| Cron | Job locking | In-memory | Redis |
Default Adapters
For single-instance deployments. No configuration needed.
Where data goes:
- State:
.motia/motia.state.json - Streams:
.motia/streams/ - Events: Process memory
- Cron: Process memory
Distributed Adapters
For multi-instance deployments. Shares state and events across instances.
Redis State
Install:
Redis Streams
Install:
RabbitMQ Events
Install:
Redis Cron
Install:
All Together
Using all distributed adapters:
When to Use What
Default adapters:
- Single Motia instance
- Development
- Testing
- Simple deployments
Distributed adapters:
- Multiple Motia instances
- Horizontal scaling
- Production deployments
- High availability
Need help? See our Community Resources for questions, examples, and discussions.