Investigate more in Mark Miller's idea for distributed persistence/snapshotting
From Martin that talked to Mark:
"A scheme to consistently checkpoint distributed state by snapshotting the outqueue rather than the inqueue.
Idea is as follows:
"A scheme to consistently checkpoint distributed state by snapshotting the outqueue rather than the inqueue.
Idea is as follows:
- Between requests: snapshot actor state + outqueue.
- Messages stay in outqueue until an ack is received from receiving actors.
- They are resent with exponential backoff.
- Receiving actor sends an ack only once message is handled and receiving actor checkpointed succesfully.
Leave a comment
on 2012-06-16 13:51 *
By Jonas Bonér
Random thoughts:
- Sounds much more expensive than classic event sourcing where only the messages in the inqueue is stored to disk (and replayed on failure), where no ACK is needed either.
- But event sourcing requires idempotent messages, so his idea could perhaps be an interesting complement for the cases where that is not possible - something that we need to do - and that we have not solved how yet.
- The outqueue will probably always be pretty small in size, but the need for ACKing makes it impossible to apply optimizations such as write-behind when writing to disk (i.e. all IO need to be done consistent with blocking).