kanwarpreet25 f7e22a1cf6 508 : Sonar qube critical Issue Fix (#854)
* 508 : Sonar qube critical Issue Fix
Refactor this method to reduce its Cognitive Complexity from 30 to the 15 allowed.

* 508: Sonar Qube Issue fxes
Define a constant instead of duplicating this literal " does not exist." 3 times.

* 508: sonar qube issue fixes
Define a constant instead of duplicating this literal "Some external api for only realtime execution could be called here." 3 times.
2019-07-28 15:42:03 +03:00
..
2017-11-28 20:55:52 +02:00
2017-08-13 01:36:52 +03:00

layout, title, folder, permalink, categories, tags
layout title folder permalink categories tags
pattern Event Sourcing event-sourcing /patterns/event-sourcing/ Architectural
Java
Difficulty Intermediate
Performance

Intent

Instead of storing just the current state of the data in a domain, use an append-only store to record the full series of actions taken on that data. The store acts as the system of record and can be used to materialize the domain objects. This can simplify tasks in complex domains, by avoiding the need to synchronize the data model and the business domain, while improving performance, scalability, and responsiveness. It can also provide consistency for transactional data, and maintain full audit trails and history that can enable compensating actions.

alt text

Applicability

Use the Event Sourcing pattern when

  • You need very high performance on persisting your application state even your application state have a complex relational data structure
  • You need log of changes of your application state and ability to restore a state of any moment in time.
  • You need to debug production problems by replaying the past events.

Real world examples

Credits