问题
I am seriously thinking of using EvenStore from Greg Young, for implementing a system based on events. However, I am not sure whether EventStore from Greg Young supports Snapshots. Snapshots are key requirement for my application as we do not want to replay all the events to construct object state every time.
Could anybody provide me with samples on how to create snapshots in EventStore (Greg Young Version)?
回答1:
Yes, just put them in a stream and read the first value of that stream.
Eg:
/streams/foo
/streams/too-domainsnapshot
When reading read the last snapshot off snapshot stream then read forward from the version it points to.
You can also have many streams with many different snapshots. I believe the common domain wrappers support this already.
Also this would be answered faster likely in our discussion group (linked on website)
来源:https://stackoverflow.com/questions/16359330/is-snapshot-supported-from-greg-young-eventstore