Snapshotting

502 views
Skip to first unread message

Chris Martin

unread,
Oct 25, 2012, 7:05:12 PM10/25/12
to event...@googlegroups.com
In the documentation under "What is an Event Store?", you speak of Rolling Snapshots. Is there any support for this baked in?

If not, is there an extensibility hook to add it myself?

Thanks,
Chris

Greg Young

unread,
Oct 26, 2012, 2:50:11 AM10/26/12
to event...@googlegroups.com
A snapshot just goes in another stream. When creating that stream you can say on the meta data of the create $maxCount = 1 which tells the event store you only needed the last entry. It will scavenge old versions of you snapshot for you. Eg I could have a stream foo and I could have foo_snapshot. When you read you would read _snapshot then read foo from version forward.
--
 
 


--
Le doute n'est pas une condition agréable, mais la certitude est absurde.

Greg Young

unread,
Oct 26, 2012, 2:54:28 AM10/26/12
to event...@googlegroups.com
It being this is a common usage scenario it might be good for us to drop it I to the facade (or to put a facade/example on top of the connection)

Wayne Douglas

unread,
Oct 26, 2012, 7:34:16 AM10/26/12
to event...@googlegroups.com
where are the docs?!

--
 
 



--
--------------------

w://

t: 07525424882

--------------------


Greg Young

unread,
Oct 26, 2012, 7:45:19 AM10/26/12
to event...@googlegroups.com

This is covered in docs ($maxcount in reserced names). We are adding many more docs as well.

--
 
 

Wayne Douglas

unread,
Oct 26, 2012, 7:55:32 AM10/26/12
to event...@googlegroups.com
where are they kept though?

am I being blind - probs - but i can't find them!

:p

Greg Young

unread,
Oct 26, 2012, 8:01:25 AM10/26/12
to event...@googlegroups.com

On geteventstore.com in doc section

--
 
 

Wayne Douglas

unread,
Oct 26, 2012, 8:09:53 AM10/26/12
to event...@googlegroups.com
but i cant find anywhere where it says "docs" :p

i'm being slow i think

Greg Young

unread,
Oct 26, 2012, 8:13:01 AM10/26/12
to event...@googlegroups.com

http://geteventstore.com/docs/

I believe there is a link but this may help. There are more coming as well as examples.

Cheers

Greg

--
 
 

Andrii Nakryiko

unread,
Oct 26, 2012, 8:43:38 AM10/26/12
to event...@googlegroups.com
Hi Wayne,

The gray button "Docs" to the right of the big green button "Download
now at GitHub". Missed it first time as well :)

-- Andrii Nakryiko


2012/10/26 Wayne Douglas <wa...@prjatk.com>:
> --
>
>

Wayne Douglas

unread,
Oct 26, 2012, 8:46:03 AM10/26/12
to event...@googlegroups.com
oh yeah!!

that's too hard to see - it needs to be on the top menu no?

Chris Martin

unread,
Oct 26, 2012, 11:32:16 AM10/26/12
to event...@googlegroups.com
Doh!

It never occurred to me to exploit the software for this. ;)

Thanks!

Scott Cate

unread,
Oct 28, 2012, 5:57:45 PM10/28/12
to event...@googlegroups.com
As a heads up for everyone, the first event in your stream is StreamCreated, not the first event you put in it.

So if you're expecting version 1, you'll actually get version 2 straight away.

Makes perfect sense, and maybe it's even documented somewhere, but it threw us for a few minutes to figure it out.

Happy Coding!

@scottcate

Greg Young

unread,
Oct 28, 2012, 6:17:33 PM10/28/12
to event...@googlegroups.com
Yes the first event is the streamcreated we have had discussions about hiding this vs showing it.

Chris Martin

unread,
Oct 28, 2012, 6:23:22 PM10/28/12
to event...@googlegroups.com

It's not that big a deal.

An aggregate will throw it away during replay and in the case of a snapshot, a null memento will be deserialized and I can ignore it.

Or I can just ignore eventtype=="StreamCreated". :)

--
 
 
Reply all
Reply to author
Forward
0 new messages