J Oliver EventStore V2.0 CommonDomain Snapshot

761 views Asked by At

Whats considered best practice to take Snapshots of the aggregates when using EventStore and CommonDomain (Is there a better place to ask, usergroup, something like that) ?

1

There are 1 answers

6
Jonathan Oliver On

Stack Overflow is the best place for questions because everyone can benefit from the answers.

Snapshots should generally be taken "out of band"--that is out of the mainline of processing. In other words, when a series of events are being committed, you don't want to take a snapshot at that point. Instead, you'll want to have another thread or process take a snapshot asynchronously. I recommend another thread instead of a completely separate process because you don't have to worry about making sure your assemblies (domain, message, etc.) are the same as that for your main processing threads.

The code for "how" to take a snapshot is left up to you, the end user. I will very likely provide some additional guidance in the next week or so on the exact steps for taking a snapshot.

One additional consideration is, do you really need snapshotting? How many streams do you have that go above 1000 events? If none, then you almost certainly don't need the complexity of snapshotting.