nuts-foundation / nuts-event-octopus

Nuts service space engine for making sure events are caught and relayed.
GNU General Public License v3.0
0 stars 0 forks source link

Add event-sourcing Events #33

Open stevenvegt opened 4 years ago

stevenvegt commented 4 years ago

To introduce tracibility we introduce event logs which can be used for event sourcing. The Nuts Event Octopus will provide the generic infrastructure. Specific engines will provide the data types used for encoding engine events.

A generic event-souring event consists fo the following fields: Field name type comment
EventID string sha1 of the byte value of the subsequent fields
AggregateID string
AggregateType string
Timestamp int Time in seconds since unix epoch
CausedBy string Nuts identity
Data string JSON Object with which has meaning for the subscribed party

The current primary use-case is the consent store.

Event Octopus should be able to

woutslakhorst commented 4 years ago

Replaying from an AggregateID might be difficult todo with Nats. It's more sort-of a by type replay...

stevenvegt commented 4 years ago

Octpus needs a extra datastore like reddis for that. Than its just an array per aggregateId.

woutslakhorst commented 4 years ago

Octpus needs a extra datastore like reddis for that. Than its just an array per aggregateId.

that would mean you have to implement the event sourcing yourself with reddis as backend on aggregateId level. Nats would only be able to replay on type level?