Persistence
A persistence stores the state of running workflows between messages. This page lists the persistence adapters maintained with the bus. A service that doesn't use workflows doesn't need one.
By default the bus keeps workflow state in memory, with InMemoryPersistence. That's only for development: the state is lost when the process stops, and isn't shared between instances of a service. Because a durable persistence keeps the state in a database, any instance can handle a workflow's next message, services can be scaled in and out freely, and a restart loses nothing.
Every persistence uses optimistic concurrency: saving fails if another handler saved the same workflow instance since it was read, and the message is retried with the latest state.
A persistence instance can be shared by several buses in one process. Each bus converts the state with its own serializer and message types, and the persistence is disposed when the last bus that uses it is disposed.
See also
- Transports
Persistencein the API reference