Event sourcing
Events can be used to advertise the changes in the state of the entities managed by a microservice. In such cases, events carry the updated state of the entity including the entity identifier and the values of the fields that have changed. It is also recommended to include a unique identifier and version number as well with each update event. Any interested microservice can then subscribe to these events via a message broker and receive the changes to update the state of the entity locally. The Lookup Service of the Helping Hands application is one such service that listens to all the state change events generated by the consumer, provider, and order microservices to keep an updated dataset for users to look up.
One of the ...
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