Event sourcing

from Wikipedia, the free encyclopedia

Event Sourcing ( ES ) is a process in which all changes in the status of a software application are mapped and recorded as a sequence of events . Event sourcing is counted among the analysis patterns .

implementation

Functions and methods are initially divided into queries and commands according to the CQS principle . Commands are mapped as events and sent to an Enterprise Service Bus (ESB).

All events are recorded by an event store . Database systems are used here. Alternatively, hard disk drives can be written directly to the file system , which has a higher streaming performance than databases .

The use of an event store has the advantage that all changes to the system can be reproduced deterministically at any time by repeating the events. This offers advantages in terms of traceability, for example for legal reasons or in debugging . In order to increase the performance when restoring a given state, snapshots of the current state are taken at regular intervals .

For the individual events, event handlers are registered on the ESB . B. carry out status changes on denormalized databases, send e-mails or log errors.

advantages

  • High scalability
  • Easy adaptation to changing business requirements
  • Traceability, as all changes are recorded
  • Subsequent data analysis possible at any time
  • Deterministic error analysis possible

disadvantage

  • High implementation effort

Web links

swell

  1. Martin Fowler: Event Sourcing. December 12, 2005, accessed July 13, 2014 .
  2. Event Sourcing Pattern. In: MSDN. Microsoft, accessed July 13, 2014 .