Software Development

What are the pros and cons of using Event Sourcing in a Microservices Data Architecture?

S Asked by Steven King · 22-09-2024
0 upvotes 5,967 views 0 comments
The question

I'm looking into Event Sourcing to ensure we never lose the state of our financial transactions. However, I am worried about the complexity of "Snapshots" and "Projections." Is the overhead of rebuilding state from an event log worth the auditability benefits in a high-traffic system? 

3 answers

0
D
Answered on 05-11-2024

Event Sourcing provides an unparalleled audit trail because you store every single change as an immutable event. For financial systems, this is a gold standard. The downside is indeed the complexity of projections (the "read" models). You have to manage the eventual consistency between your event store and your queryable database. Snapshots are essential; otherwise, as your event log grows to millions of entries, "replaying" the events to find the current balance of an account would take far too long. It’s a powerful pattern, but only use it where the history of data is as important as the current state.

0
DA
Answered on 10-11-2024

How do you handle schema evolution in an Event Sourcing system when the structure of your historical events needs to change but the log is immutable?

PA 14-11-2024

Daniel, we usually use "Upcasting." When the system reads an old event version, a mapper transforms it into the new schema format on-the-fly before the application logic processes it.

0
KA
Answered on 20-11-2024

It’s great for debugging. Being able to "replay" a bug by running the exact same sequence of events through a local environment is a lifesaver for any backend dev. 

DO 25-11-2024

I agree with Karen. The ability to reconstruct the state at any specific point in time makes root cause analysis for production issues significantly more manageable.

Share your thoughts

Your email address will not be published. Required fields are marked (*)

Professional Counselling Session

Still have questions?
Schedule a free counselling session

Our experts are ready to help you with any questions about courses, admissions, or career paths. Get personalized guidance from industry professionals.

Request a Call Back

Search Online

We Accept

We Accept

Follow Us

"PMI®", "PMBOK®", "PMP®", "CAPM®" and "PMI-ACP®" are registered marks of the Project Management Institute, Inc. | "CSM", "CST" are Registered Trade Marks of The Scrum Alliance, USA. | COBIT® is a trademark of ISACA® registered in the United States and other countries.

Book Free Session