0
0
Microservicessystem_design~3 mins

Why Event store concept in Microservices? - Purpose & Use Cases

Choose your learning style9 modes available
The Big Idea

What if you could rewind time and see every change your system ever made?

The Scenario

Imagine a busy office where every decision and change is written on sticky notes and scattered across desks. When someone needs to understand what happened, they have to search through piles of notes, hoping to find the right one.

The Problem

This manual way is slow and confusing. Notes get lost or mixed up, and it's hard to track the order of events. If you want to fix a mistake or understand why something happened, you waste time and risk errors.

The Solution

An event store acts like a neat, organized notebook that records every change in order. It keeps a clear history of all actions, making it easy to replay events, find mistakes, and understand the system's state at any time.

Before vs After
Before
updateUser(userId, newData)
// directly change data without history
After
eventStore.append({ type: 'UserUpdated', data: newData })
// record event instead of direct change
What It Enables

It enables reliable tracking and rebuilding of system state by storing every change as an event.

Real Life Example

In online shopping, an event store records each step: item added to cart, payment made, order shipped. This helps fix issues and understand customer actions clearly.

Key Takeaways

Manual tracking is messy and error-prone.

Event store records every change as an ordered event.

This makes systems easier to debug, audit, and rebuild.