Skip to content

mvcguy/eventstoreplay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EventStore and DDD play by play

A play project to demonstrate DDD (Domain driven design) using EventStore.

The goal is to create a microservice with a simple aggregate and an aggregate child. The hypothetical aggregate in this is called 'ValueAggregate' with a child called 'ValueComments'. They hold a one-to-many relationship.

Beside the aggregate the solution contains a read model, which is listening to the events generated by the eventstore as a result of changes to the aggregate. The read model persists the state of the aggregate to a mongo database. The idea is to separate the read model from the write model for faster read operations.

The solution also contains a React client which provides an interface to perform read/write operations on the domain.

We will follow all the best practices available out there.

The important thing here to maintain data consistancy/integrity through versioning of the aggregate. As this is a distributed system, and race conditions can arise any time, we will check if the client has passed the correct version while doing an update. If the version mismatch, the operation will be rejected.

It is important to mention that we will be using one stream (we are using eventstore) for each aggregate instance. All the childs of the aggregate will write to this same stream. In this way we can use the EventStore built in transaction facility. If any of the event fails to commit, the whole batch of events will be rolled back.

About

A play project to demonstrate DDD (Domain driven design) using EventStore

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages