Akka Persistence keeps actor state durable when sharding relocates entities or processes fail. Instead of replacing one stored value, it records each accepted state change as an event in an append-only journal. section 9.1 section 9.2
A persistent actor follows this sequence:
- Receives a command expressing an intended state change. section 9.2
- Validates the command against current state and generates an event only when accepted. section 9.2
- Stores the event in the journal and applies it through an event handler. section 9.2
- Replays the journal after restart to reconstruct the latest state; snapshots reduce recovery work. section 9.2
Durable wallet
A sharded wallet starts with a zero balance and persists FundsAdded, FundsReserved, or FundsReservationDenied events. It accepts a reservation when the balance is sufficient, rejects it otherwise, and updates the balance by handling the resulting event. Snapshot retention and restart backoff support recovery after failures. section 12.1.1
Trace how a validated command becomes a stored event before examining recovery through journal replay. section 9.2
Follow the persistent actor’s restart path from journal history back to reconstructed state. section 9.2
