Should events be immutable?

Should events be immutable?

Events are immutable because they represent domain actions that took place in the past. Unless you’re Marty McFly, you can’t change the past, and sometimes not even then.

What are the advantages of an event-driven architecture?

An event-driven architecture enables businesses to capture events as they occur and process complex multi-step decisions in real time — maximizing application responsiveness and enabling telcos to ensure improved customer experience and optimized network utilization converting event interactions into stronger profits.

Why should events contain immutable data?

Immutable data help you in all three points: We can inform the user of all changes to their data, and these changes can be as visible we need to make them. If the user saw the erroneous data before, we can expose functionality to allow them to trace and audit the changes made since they saw it, providing comfort.

What is the difference between a request driven and event-driven software architecture?

In req/response services are tied up. In event driven system it’s responsibility of publisher to include everything that other services can use. In case the event doesn’t contain everything that it needs then you can’t publish event at the first place so you need to make sure that’s the case.

What are events and commands?

Events represent a past, something that already happened and can’t be undone. Commands, on the other hand, represent a wish, an action in the future which can be rejected. An event has typically multiple consumers, but a command is addressed to only one.

Why do event logs have to be immutable?

Since each event represents something that has happened in the past then it makes sense to be immutable. That is extremely important, particularly when using the event logs to keep tracking of changes to our application. However, we may also attach some mutable data that has no side effects such as the result of the processing.

Why are events in an application immutable?

Events flow in the application carrying some data along. Since each event represents something that has happened in the past then it makes sense to be immutable. That is extremely important, particularly when using the event logs to keep tracking of changes to our application.

How are events encapsulated in an event model?

Each event is encapsulated into an event model, an event object. The event processor is what reads the events from the log and processes them causing our application to do whatever it’s supposed to do. The event log can be split into muliple logs and use a separate processor for them.

Is the event log split into muliple logs?

The event log can be split into muliple logs and use a separate processor for them. While most of the interactions are asynchronous, that is not always the case. A request sent to the event processor directly demanding the customer address change and waiting for a response can be a synchronous task.