Aggregate root
An aggregate root is the designated domain object through which an aggregate’s members are accessed and its consistency rules are enforced.
Spring in Action, Sixth Edition
The designated domain object that serves as the entry point for access to the objects within an aggregate.
- How it is used
- Organizes order persistence around a domain object that owns its dependent tacos.
- How deep it goes
- Explains aggregate boundaries and JDBC save steps, then contrasts R2DBC repository behavior and MongoDB document mapping.
- Examples
- Uses a taco order, its tacos, ingredient references, and an order repository to illustrate aggregate boundaries.
- What you can do after
- Apply it via Spring repositories by organizing persistence around an order and its dependent tacos.
Read how Spring in Action, Sixth Edition explains aggregate root →
Simple Object-Oriented Design: Create clean, maintainable applications
An aggregate root is the designated domain object through which an aggregate's members and consistency rules are accessed and modified.
- How it is used
- Uses aggregate roots to control updates to complex object graphs and keep domain invariants consistent.
- How deep it goes
- Defines access and repository rules, then works through enrollment and cancellation updates while deferring deeper aggregate design.
- Examples
- Uses Basket with Items and Products, then Offering with Enrollment, available spots, enrollment, and cancellation.
- What you can do after
- Apply it by routing aggregate changes and persistence through a root while evaluating when smaller aggregates or eventual consistency fit.
Collaborative Software Design: How to facilitate domain modeling decisions
An aggregate root is the designated domain object through which modifications to an aggregate are managed.
- How it is used
- Uses aggregate roots to preserve business invariants while translating collaborative models into executable code.
- How deep it goes
- Explains consistency boundaries, transactions, invariants, and a simplified implementation, while stopping short of a complete production design.
- Examples
- Demonstrates ScheduledMovieSeating for seat allocation and ScheduledMovie for ticket capacity and request-size constraints.
- What you can do after
- Apply it by grouping related domain objects and routing invariant-sensitive modifications through one aggregate root.
Clean Applications with Hexagonal Architecture
The entity at the head of an aggregate that owns its consistency boundary and controls state changes within it.
- How it is used
- Defines the entity that owns an aggregate’s consistency boundary and mediates its state changes.
- How deep it goes
- Implements creation, reconstitution, and guarded publication; leaves legacy-data reconciliation to a separate domain strategy.
- Examples
- Uses Article creation, reconstitution, and publishing to demonstrate guarded transitions and recorded domain events.
- What you can do after
- Understand how to route lifecycle changes through a root while preserving aggregate-wide invariants.
Read how Clean Applications with Hexagonal Architecture explains aggregate root →
What to know first
- entityAn entity is a distinct, identifiable object, concept, participant, or record represented in a system's model or data.
- SQLSQL is a standardized declarative language for defining, querying, and manipulating data in relational database systems.
Related concepts
- domain-driven designused by · Domain-driven design is a software design approach that centers models, structure, and terminology on the concepts, behavior, and boundaries of a problem domain.
- 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.
- Spring Data R2DBCcontrasts with · Spring Data R2DBC is a Spring Data project that provides repository-based persistence for relational databases through the Reactive Relational Database Connectivity API.
- consistencyaddresses · Consistency is the degree to which related data, behavior, or results agree with one another and conform to applicable rules or expectations.
- subdocumenthas part · A subdocument is a document nested within another document and stored as part of the containing document.
Questions about aggregate root
What is aggregate root?
An aggregate root is the designated domain object through which an aggregate’s members are accessed and its consistency rules are enforced.
Which Manning books explain aggregate root?
Spring in Action, Sixth Edition, Simple Object-Oriented Design: Create clean, maintainable applications, Collaborative Software Design: How to facilitate domain modeling decisions and Clean Applications with Hexagonal Architecture.
What should I know before learning aggregate root?
Manning books that teach aggregate root usually introduce entity and SQL first.
What is the difference between aggregate root and Spring Data R2DBC?
An aggregate root is the designated domain object through which an aggregate’s members are accessed and its consistency rules are enforced. Spring Data R2DBC is a Spring Data project that provides repository-based persistence for relational databases through the Reactive Relational Database Connectivity API.
What kinds of aggregate root are there?
Kinds of aggregate root include training offering.
What are the parts of aggregate root?
Aggregate root includes subdocument.
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.



