Aggregate
A domain-driven design aggregate is a cluster of related domain objects treated as a unit for consistency and state changes, typically accessed through a designated root.
Collaborative Software Design: How to facilitate domain modeling decisions
A consistency boundary is a boundary within which related state must satisfy business invariants as a single consistent unit.
- How it is used
- Uses aggregates to turn collaborative modeling constraints into implementable boundaries that preserve business invariants.
- How deep it goes
- Explains boundaries, transactions, aggregate roots, and invariant enforcement, then stops short of a complete implementation.
- Examples
- Uses seat allocation, scheduled movies, tickets, rows, and a simplified ScheduledMovie aggregate to illustrate invariant enforcement.
- What you can do after
- Builds aggregate boundaries and methods from modeled constraints while keeping related domain objects internally consistent.
Simple Object-Oriented Design: Create clean, maintainable applications
An aggregate is a cluster of related domain objects treated as a consistency boundary and accessed through a designated root.
- How it is used
- Defines a consistency boundary for clusters of domain objects and their persistence.
- How deep it goes
- Explains root-only access, repository boundaries, and a worked Offering–Enrollment design; defers deeper aggregate-root design.
- Examples
- Uses Basket–Item–Product and Offering–Enrollment relationships, including enrollment cancellation and available spots.
- What you can do after
- Apply it by routing related changes and persistence through an aggregate root while evaluating exceptions pragmatically.
Read how Simple Object-Oriented Design: Create clean, maintainable applications explains aggregate →
Spring in Action, Sixth Edition
An aggregate is a domain-driven design cluster of related objects treated as a unit for consistency and lifecycle management.
- How it is used
- Organizes domain objects and directs repository operations around an aggregate root.
- How deep it goes
- Defines membership and demonstrates multi-table saving, but defers broader domain-driven design beyond aggregates and roots.
- Examples
- Uses TacoOrder, Taco, Ingredient, IngredientRef, SQL tables, and a JdbcOrderRepository save operation.
- What you can do after
- Build it from scratch by defining an aggregate root, repository, schema relationships, and coordinated JDBC persistence.
Read how Spring in Action, Sixth Edition explains aggregate →
Grokking Software Architecture
An aggregate is a group of related data treated as a single unit for storage and operations.
- How it is used
- Frames aggregates as a NoSQL data-modeling approach for grouping related data into a unit retrieved together.
- How deep it goes
- Defines aggregates and explains read and update tradeoffs through a customer example, without exploring implementation internals.
- Examples
- Uses a customer document bundling profile, addresses, and recent orders to illustrate aggregation.
- What you can do after
- Evaluate read-performance gains against the difficulty of updating specific data across multiple aggregates.
Read how Grokking Software Architecture explains aggregate →
Also covered in
- Clean Applications with Hexagonal ArchitectureIn early access (MEAP)
- Architecture Modernization: Socio-technical alignment of software, strategy, and structure
- API Design Patterns
What to know first
- domain-driven designDomain-driven design is a software design approach that centers models, structure, and terminology on the concepts, behavior, and boundaries of a problem domain.
- commandA command is an instruction or representation of a requested operation that a system can execute, often with parameters and potentially changing state.
- entityAn entity is a distinct, identifiable object, concept, participant, or record represented in a system's model or data.
- enumAn enum is a type whose values are selected from a finite set of named alternatives.
Related concepts
- enumcontrasts with · An enum is a type whose values are selected from a finite set of named alternatives.
- aggregate orientationused by · A data modeling approach that groups related data into a single atomic aggregate for storage and retrieval.
- invariantaddresses · An invariant is a condition or property that must remain true across the specified valid states, operations, or transformations of a system or computation.
- domain eventproduces · A domain event is a record of a significant occurrence or change in a business domain that may prompt subsequent behavior or decisions.
- persistence modelcontrasts with · A representation of application data shaped for storage and retrieval by a persistence technology.
- domain-driven designpart of · Domain-driven design is a software design approach that centers models, structure, and terminology on the concepts, behavior, and boundaries of a problem domain.
Questions about aggregate
What is aggregate?
A domain-driven design aggregate is a cluster of related domain objects treated as a unit for consistency and state changes, typically accessed through a designated root.
Which Manning books explain aggregate?
Collaborative Software Design: How to facilitate domain modeling decisions, Simple Object-Oriented Design: Create clean, maintainable applications, Spring in Action, Sixth Edition and Grokking Software Architecture.
What should I know before learning aggregate?
Manning books that teach aggregate usually introduce domain-driven design, command, entity and enum first.
What is the difference between aggregate and enum?
A domain-driven design aggregate is a cluster of related domain objects treated as a unit for consistency and state changes, typically accessed through a designated root. An enum is a type whose values are selected from a finite set of named alternatives.
What is aggregate part of?
Aggregate is part of domain-driven design. Domain-driven design is a software design approach that centers models, structure, and terminology on the concepts, behavior, and boundaries of a problem domain.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.



