EVENT-SOURCING-EDI
Event sourcing (EDI) is the architecture pattern where system state is derived from an append-only log of immutable events — well suited to EDI flows where every INVOIC, MDN, status becomes a source-of-truth event.
Definition
Event sourcing inverts CRUD logic: instead of storing current state, you store the sequence of events leading to that state. Current state is rebuilt by replay. For EDI, this aligns with the 'immutable message' nature of the domain.
Origin
Old concept (1990, Distributed Object Computing) popularised by Martin Fowler in 2005 and Greg Young in 2010. Aligned with Kafka, EventStore DB, AWS Kinesis.
Use
An EDI gateway stores in Kafka all its events: invoice_received, invoice_validated, mdn_sent, mdn_acknowledged, invoice_archived. The 'invoice_state' projection is rebuilt on demand. Replay a month for debugging = trivial.
Related terms
- Kafka — main transport.
- CQRS — classical pair.
- Audit trail — natural use case.
- Replayability — target property.