Aggregate (DDD)
A cluster of objects changed as one unit, with a single root that enforces the business rules and marks the boundary of one transaction.
An order with its lines is an aggregate: you change lines only through the order, and the order checks that the total stays within the credit limit. One transaction changes one aggregate; other aggregates are referenced by id and updated through events. Aggregates that are too large cause lock contention; too small, and the rules leak into services.
Related terms
- DDD (domain-driven design): Designing software around the business’s own language and rules, with the code split where that language changes meaning.
- Transactional outbox: Saving an event to an outbox table in the same database transaction as the change itself, then publishing it to the broker separately.
- Message ordering: Whether a queue delivers messages in the order they were sent; usually guaranteed only per key or partition, if at all.
