Building Microservices Through Event-Driven Architecture, Part 8

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

Learn more about implementing event sourcing!

In this article, I will talk about Event Sourcing implementation on Repository.

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 3: Presenters, Views, and Controllers

Learn how to build your microservices through event-driven architecture.
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 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.