O'Reilly logo

Practical Microservices by Umesh Ram Sharma

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Event sourcing

A powerful data-modeling methodology that can help us avoid data sharing in microservices, even in very complicated cases, is event sourcing. This is one of the best ways to deal with data modeling in a microservice. An event is an action that happened in the past, and it's not a snapshot of a state. An action itself is equipped with all the information that's necessary to replay it. Data in a database is actually a state gained after performing a stream of events. So, the assumption here is that the same database state can be achieved if the same set of events are processed in the database in the same order. Examples of event sourcing are version control systems that store the current state as differences. The current state ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required