Question
Design dependency-tracked cache invalidation for a GraphQL/API layer where a single cached response is derived from many underlying entities (a user's dashboard caches data from 12 different objects). When any underlying entity changes, exactly the cached responses that depend on it must be invalidated — no more, no less. Over-invalidation kills hit rate; under-invalidation serves stale data. Design how you track dependencies between cached responses and source entities at scale (millions of cached responses), and the trade-offs of the tracking granularity.
Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts — data model, bottlenecks, consistency, failure modes — and name the trade-offs you are making.