Streams, Snapshots, Denormalization

Hi,

At this time the developers have decided to use a stream per event (and i mean event, not event type or anything). Which means we have as many streams as we have events. To me who is responsible for ops on the event store it feels weird and causes few issues, the biggest being snapshots. How do you do snapshot in this context ? I can’t conceptualize a way to actually do it in a way that makes sense (to me). It makes loading data from a point in time other than inception impossible. At least not from the event store only. I’d have to load the read model at the same point in time and then replay events.

Considering the application, to me streams should be related to an instance of an object and it would contain the initial state at its creation, all event that happened. To take a simple example, a user account would be a stream. The first event would contain a blank form of the account and all subsequent events would contain modifications to the initial blank object. Name update, email updates, etc… When taking a snapshot, we would take all the past event since inception (or previous snapshots), apply them to the object and save the state.

Which brings me to snapshots. When taking a snapshots via the WebUI or a command, is the event store actually able to denormalize (if i understand the usage correctly here) the object and store its state or do we need to tell it how ?

Also, can snapshoting be used in a valid manner in the current way the devs are using it ? If so, how ?

Regards,

"Considering the application, to me streams should be related to an
instance of an object and it would contain the initial state at its
creation, all event that happened."

This is how most people do it. They have a stream per conceptual thing
such as a stream per bank account in a banking system (not a stream
per ledger entry).

"The first event would contain a blank form of the account " Why not
just have the first event be "AccountCreated"?

"When taking a snapshot, we would take all the past event since
inception (or previous snapshots), apply them to the object and save
the state."

This is exactly what most people do. That said snapshots have a cost
(versioning) and for many systems you really don't want snapshots.

Cheers,

Greg

This video may help https://www.youtube.com/watch?v=JHGkaShoyNs

Well the first event could be AccountCreated too, but then you might miss some information :slight_smile: (As in removed 1 item from cart). For some type of accounts we actually have to do a match up against a DB provided externally. Thus we gather the name first, and see if we have 1 or more correspondence in that DB, then the province, then the city, then the address, etc… Even though it might not be useful at the moment, knowing how many times we actually had to go down to the address could be useful in the future or it could help revamp the web site design. Or the process of gathering data could be another process altogether. It is just a matter of choice.

In which cases do we not want snapshots? And could you clarify what the “snapshot” button on the WebUI actually does ?

As for our scenario, throwing hardware at it seems to be a pretty expensive solution especially with enterprise grade reliability. After all storage is not just storage. IE: Considering an event store with a dozen TB of data, if a node crash, you’d have to actually get the data from another node, ship it and then load it. It is a good thing we have physical access to our DCs at the moment. If it were cloud, that would be supremely painful bandwidth wise. It is also power, space, migration, bandwidth etc…

"In which cases do we not want snapshots? And could you clarify what
the "snapshot" button on the WebUI actually does ?"

It takes a snapshot of the data in the queues screen so you can
copy/paste it etc you can't do that while its autoupdating (you will
lose your selection as it updates). See attached image.

There is no form of snapshotting built into event store this is
something you would do on your own.

Re problems. Snapshots have versioning problems. Let's say you were
snapshotting a domain object, what happens if you add a field to it?
You have to delete and rebuild all of your snapshots.

Screenshot from 2016-05-25 17-24-17.png