[Django]-Event Sourcing With an Event Store and an ORM

5đź‘Ť

Does anyone see any caveats with this approach or would it be better to implement this in the save method of the model ?

The usual design separates the domain model (aka business logic) from the persistence concerns.

If the sequence of events are your source of truth, two things follow: first, you want to be sure that you successfully store your events before they are published. Second, you want to be sure that your write semantics are “first writer wins”.

If you get that right, and everybody understands that the model in the database can be “behind” the events in the event store in time, then you are in good shape.

Eventually consistent systems make “read your own writes” expectations challenging. So you may have some extra work there.

Leave a comment