System Design (Day - 8)

Event Driven Architecture
its similar to the Pub/Sub model, but not completely, a bit of difference is there, we’ll discuss that below.
Real world examples that are using Event driven architecture
1. Git
2. React
3. NodeJS
4. Gaming servers etc…
1.Its same as the publisher subscriber, but instead of messaging queue, Event Bus which receives the event that has to be triggered by the another server, in that server the data is stored inside the database that is connected to it which is useful because the data is available for that particular server, if any parent server fails then it can access it from it’s own database, it’ll store the data that is useful for that server and also other data. but wait what about consistency, the data is not consistent with each other server because of the local database storing feature.
2. we can easily roll back to the previous state, through the event logs, if we got any bugs in the current code then we can easily roll back to the previous state. that’s a very big advantage.
3. Let’s say if any server down then that server can be easily replaceable, we need to create a server and just we need to transfer the data into the new servers database, that’s it.
4. Transactions that happens between servers has two sides like at least one and at most one, in at most one the event will be triggered then we don’t care if it reached or not, in other hand at least one means an event triggered then if it has to be reached to the subscriber definitely, if it fails then it’ll retry until it reaches to that server successfully.
5. its already decoupled so much that, we can change the server and replace it with each other, like if
we have email service from x vendor, and we want to change that vendor means we have to replace that server that’s it done
Subscribe to my newsletter
Read articles from Manoj Kumar directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
