CQRS-EDI
CQRS (EDI) is the Command Query Responsibility Segregation pattern — splitting write models (Commands) from read models (Queries) in a high-traffic multi-tenant EDI system.
Definition
CQRS splits the model in two: Command side (mutations) and Query side (reads). Both can have different schemas and stores, synchronised by events (Event Sourcing helps but is not mandatory). Allows independent read-side scaling.
Origin
Concept formalised by Greg Young in 2010 (derived from Bertrand Meyer's 1986 CQS paper). Widely applied in finance, e-commerce and now EDI.
Use
An EDI gateway distinguishes: Command side (EDIFACT INVOIC ingestion → normalised Postgres for ACID), Query side (Elasticsearch views indexed by partner/date for operator queries). Both synchronised by a Kafka 'invoice.events' topic.
Related terms
- Event sourcing — common foundation.
- Saga pattern — orchestration complement.
- Kafka — event transport.
- Elasticsearch — query store.