aggregate
A cluster of related data that is always loaded, changed and saved together as one unit, such as an order with its line items.
In more detail
The idea comes from domain-driven design. A document naturally holds one aggregate, so a document store fits when aggregate ownership is clear. Invariants that span several aggregates need a transaction or a saga.
Related terms
- document database — A NoSQL database that stores each record as a flexible document, usually JSON, with its own nested structure.
- invariant — A rule that must always hold for an object or system, such as a count never being negative.
- entity — A thing in an application's domain with its own identity, such as a user, account or product, usually stored in a database.
Taught in
- The Storage Decision: Relational Versus Document — Scalable System Design & Distributed Architecture
- Observability As A Design Input — Scalable System Design & Distributed Architecture