“Instead of storing just the current state of the data in a domain, use an append-only store to record the full series of actions taken on that data. The store acts as the system of record and can be used to materialize the domain objects.”
Database
Most of us are familiar with a relational database, these can be used to store the sequence of events. The following example was adapted from https://eventflow.readthedocs.io/
1 | /* MS SQL */ |
- id; global id you can use to order the events
- entity_id; links to a table of entities
- data; serialized entity (JSON)
- meta_data; tracking information such as
time stamp
,action performed by
anything useful to track the event