Offline snapshots

63 views
Skip to first unread message

HP

unread,
Nov 10, 2013, 8:06:04 PM11/10/13
to events...@googlegroups.com
Hi guys, do we have a way of creating offline snapshots safely while there is an active application which continues to log new events?

I thought of just instantiating a new instance of the application and pointing it to the same journal but then I wasn't sure how "safe" it would be and if there was a chance of corrupting the sequence number value by doing this.

It would be awesome if I could have a "read-only" replay of events onto my event sourced actor and then have it take a snapshot which I can use later for recovery or as a method of rebuilding internal state after a code change affected the structure of internal actor state for faster recovery on deployment of this change.

e.g.
Version 1 of Eventsourced Actor A is in production.
Version 2 of Eventsourced Actor A is in test/staging

I create an offline snapshot using Version 2 upto sequence number M

I deploy Version 2 to production, it picks up the snapshot with last command with sequence number M and continues to recover by replaying all events after M

Thanks,
Hiral

Martin Krasser

unread,
Nov 11, 2013, 12:36:05 AM11/11/13
to events...@googlegroups.com
Hi Hiral,

as long as the new application is only recovering without writing new
Messages you should be fine. You just need to make sure that the new
application writes the snapshots to a different location, unless the
structure of the state covered by the snapshots didn't change.

Cheers,
Martin
> --
> You received this message because you are subscribed to the Google
> Groups "Eventsourced User List" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to eventsourced...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

--
Martin Krasser

blog: http://krasserm.blogspot.com
code: http://github.com/krasserm
twitter: http://twitter.com/mrt1nz

HP

unread,
Nov 11, 2013, 2:08:27 AM11/11/13
to events...@googlegroups.com, kras...@googlemail.com
Hi Martin, thanks, I figured that but I was hoping there would be some way to put the journal in "read-only" mode so that I don't accidentally write to it.  Not something I want to risk in prod.

If not, maybe we could add it to the wish list.

Thanks,
Hiral

Martin Krasser

unread,
Nov 11, 2013, 10:01:05 AM11/11/13
to events...@googlegroups.com

On 11.11.13 08:08, HP wrote:
Hi Martin, thanks, I figured that but I was hoping there would be some way to put the journal in "read-only" mode so that I don't accidentally write to it.  Not something I want to risk in prod.

If not, maybe we could add it to the wish list.

This will be for sure supported by akka-persistence. Interested in opening a pull request for eventsourced (e.g. separating reads from writes in journals so that read-only journal can be created)?

HP

unread,
Nov 30, 2013, 1:25:44 PM11/30/13
to events...@googlegroups.com, kras...@googlemail.com
Created a PR for read only mode for journals.  https://github.com/eligosource/eventsourced/pull/137

Let me know what you think.

Thanks,
Hiral
Reply all
Reply to author
Forward
0 new messages