During this article, I will talk about Event-Sourcing implementation of your application. This layer surrounds the domain and implements the uses cases (the application-specific business rules). It orchestrates the data flow and uses the domain model and infrastructures, and has no dependency on a database, UI or special frameworks.
You may also like: Building Microservices Through Event-Driven Architecture, Part 7
For our event-sourcing system, I will take all the uncommitted events from the aggregate and call a function of the repository which will have the responsibility to save the events in the eventstore. So I will call the function AppendAsync(EventStore @event) of IEventStoreRepository.
Building Microservices Through Event-Driven Architecture, Part 7: Implementing Event Sourcing on Repositories
![](/storage/temp/12832981-building-microservices-event-sourcing.png)
The repository is responsible for adding events to the eventstore and also retrieving all events from the event store.
When the aggregate is saved, then all uncommitted events related to that aggregateroot are added to the eventstore table.
Building Microservices Through Event-Driven Architecture, Part 5: Dockerization
Note: The EventStore is not implemented yet, I will set up the integration tests, configure the CI/CD and I will implement the EventStore later with service bus and NoSQL database.
Building Microservices Through Event-Driven Architecture, Part 3: Presenters, Views, and Controllers
You may also like: Building Microservices With Event-Driven Architecture, Part 1: Application-Specific Business Rules
During this journey, I will implement the command side of Presenters, Views, and Controllers
In this step, I will implement the presentation. Here, the presentation is not the user interface but the Web API.
Building Microservices Through Event-Driven Architecture, Part 2: Domain Objects and Business Rules
This tutorial is the second part of a series: Building microservices through Event Driven Architecture.
During this journey, I will implement the domain model: EduSync.Speech.Domain,
Building Microservices With Event-Driven Architecture, Part 1: Application-Specific Business Rules
Image source: https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html
Today, architectures such as the onion or hexagonal patterns play an important role in the testability and maintenance of code, its independence from external frameworks, etc. In this tutorial, I will show you how to use clean architecture, with methods and tools such as Domain-Driven Design (DDD), Test (Behavior) Driven Development (TDD), CQRS, Event Sourcing, Containerization, OAuth2, and Oidc to build a microservices architecture.