Caching counts, rollups, and derived summaries so expensive computation is not repeated on every read.
Aggregate and computed-summary caching stores derived answers rather than canonical records. Typical examples include totals, counts, top-N lists, dashboard snapshots, pricing rollups, and precomputed metrics. These caches can be extremely valuable because the avoided work is often expensive. The system may be avoiding multi-step joins, repeated analytics scans, or heavy aggregation logic.
The trade-off is that derived answers often depend on many source changes. A count or KPI card may be affected by hundreds of underlying writes. That means freshness policy and recomputation strategy matter as much as the cache key itself.
flowchart LR
A["Many source records"] --> B["Aggregation logic"]
B --> C["Cached summary or rollup"]
C --> D["Dashboard or API read"]
This pattern often delivers some of the highest raw performance benefit because repeated computation can be expensive even when the final answer is small. A single cached KPI card may save seconds of backend work. But the same pattern also invites misleading precision. A dashboard that looks exact may really be a snapshot with bounded lag. Strong designs make that lag intentional and observable.
Aggregate caches are especially useful when:
They are weaker when every read requires exact real-time data or when the aggregation changes too unpredictably for stable reuse.
This example defines a cached dashboard summary with a source version and refresh timestamp. The point is to make derivation visible rather than pretending the value is raw truth.
1sales_dashboard_summary:
2 cache_key: sales:dashboard:today
3 derived_from:
4 - orders
5 - refunds
6 - exchange_rates
7 freshness_budget_seconds: 60
8 includes:
9 - gross_revenue
10 - refund_rate
11 - net_orders
What to notice:
Teams usually refresh aggregate caches in one of three ways:
The right choice depends on how expensive recomputation is and how tight the freshness promise must be. Scheduled and event-driven refresh are common because they keep expensive computation off the user request path.
What is the main modeling mistake teams make with cached summaries and dashboard values?
The stronger answer is treating derived cached outputs as if they were canonical transactional truth. Aggregate caches are useful, but they need explicit freshness budgets and source-lineage awareness to remain trustworthy.