Event sourcing
To handle events flowing through the microservice application, microservices may use the event sourcing pattern. Event sourcing persists the state of a business entity as a sequence of state-changing events. For example, a bank account may be represented as an initial amount of money and a sequence of deposit/withdraw operations. Having this information not only allows us to calculate the current account state by replaying update events, it also gives a reliable audit log of the entity changes and allows queries to determine the state of an entity at any point in the past. Usually, services that implement event sourcing provide APIs that allow other services to subscribe to entities updates.
To optimize the time required to ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access