My 2 cents for Event Sourcing

Can you go back in history and change it (of course not in reel life)? No one of us have that superpower??

Since many years the software industry leaders have realized that software world is very close to human world, that’s how the object oriented programming model evolved where an object has well defined attributes and behaviors very similar to humans, objects also have a lifetime, birth and death…isn’t it interesting?

Like an event cannot be eliminated from real/human world and if we see software world similar to human world then any event happened in software world should also not be eliminated, fair enough? BUT, traditional software development paradigm breaks this important natural alignment. How? – Normally we store the state of any application (object/entity) in persistent store (database, file etc.) and we change any existing state (considering database for simplicity) using UPDATE and DELETE operations that actually eliminates the initial state by simply overriding it, this means there is no clue that any such (original) event has happened in past which created the initial state.

Yeah, we can do different things to manage it, for example enabling history records or managing created/update columns and log the history but the point here is that we have eliminated the original state…

Point to Ponder: If any event cannot be eliminated from human world, why should it be eliminated from object world?

In modern time, the applications need not only final state but also all the previous states too for various analytics, artificial intelligence, machine learning etc. related needs. The question is how to do it in an acceptable way? What is the well-defined model, guidelines to build such systems? Often such analysis needs data and events from beginning so that different models can be applied on data or events can be replayed in sequence to determine the system’s behavior and project new state in certain situations.

Traditional software development model does not provide this capability, we need something different, latest, modern – are you able to know by now? Yes it is Event Sourcing. When I first learned about it I was amazed knowing how the model is built and executed. We can build great Microservices using Event Sourcing in association with CQRS, hence this combination opens door for building large distributed scalable systems.

Event Sourcing is an Event driven software architecture concept, read more about it from Martin Fowler’s blog here: https://martinfowler.com/eaaDev/EventSourcing.html

要查看或添加评论,请登录

Vinod Gupta的更多文章

社区洞察

其他会员也浏览了