liveBook · Manning

Aggregate

As explained in Grokking Software Architecture

An aggregate is a group of related data treated as a single unit for storage and operations.

An aggregate groups related data and treats it as one unit. In a NoSQL document database, a customer’s profile, addresses, and recent orders can live together in one document, ready to retrieve in a single operation. section 8.2.2

Bundling data makes some operations easier, but introduces a tradeoff:

  • Reading a complete entity can be faster because its related data arrives together, without joins. section 8.2.2
  • Updating a specific piece across many aggregates can be harder because each document may need to be opened and changed. section 8.2.2
Figure 8.3 Showing how NoSQL Document databases store data. Instead of splitting a customer and their orders across separate tables linked by Foreign Keys, all related information is nested into a single, self-contained document. When the application asks for Alice's profile, the database returns her orders at the exact same time; no expensive "Joins" required!

See how a customer and their orders can be nested in one document rather than split across related tables. section 8.2.2

How Grokking Software Architecture covers it

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.
How it connects
Connects aggregates to NoSQL, document databases, JSON documents, relational databases, and joins.

Also explained in

Compare how 4 books explain aggregate →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Software Architecture. The section links point to the parts of the book it draws on.