pub trait PersistenceStore: Send + Sync {
// Required methods
fn append<'life0, 'async_trait>(
&'life0 self,
envelope: PersistenceEnvelope,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
trace_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<PersistedTrace>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn resume<'life0, 'life1, 'async_trait>(
&'life0 self,
trace_id: &'life1 str,
resume_from_step: u64,
) -> Pin<Box<dyn Future<Output = Result<ResumeCursor>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
trace_id: &'life1 str,
completion: CompletionState,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn save_intervention<'life0, 'life1, 'async_trait>(
&'life0 self,
trace_id: &'life1 str,
intervention: Intervention,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Persistence abstraction for long-running workflow crash recovery.
Production-stable since 0.12 (M156).
Implement this trait to store and reload Axon execution checkpoints across
process restarts. The runtime calls append on each step and complete on
terminal outcomes. Use resume to replay a pipeline from a saved cursor.
§Built-in adapters
| Adapter | Feature flag | Best for |
|---|---|---|
InMemoryPersistenceStore | none (default) | tests, local dev |
[PostgresPersistenceStore] | persistence-postgres | durable prod storage |
[RedisPersistenceStore] | persistence-redis | ephemeral/fast checkpoints |
§See also
docs/03_guides/persistence_ops_runbook.md— operational playbookdocs/manual/04_PERSISTENCE.md— concept guide + adapter selection