Dependency-tracked cache invalidation
Your task
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.
It covers
- Dependency graph
- Fan out
- Consistency