---
id: "materialised-cache-without-rebuild-path"
type: "rule"
severity: "error"
url: "https://localhost:3000/catalogue/rules/materialised-cache-without-rebuild-path"
---

# Materialised cache without a rebuild path

A cache holds materialised data but has no in-edge from a durable store, worker or stream that could rebuild it.

| | |
|---|---|
| Severity | error |
| Selects | every node of kind cache |
| Components in scope | 37 |

## Why

A cache holding materialised views has to be rebuildable from a durable store or a worker. With nothing feeding it, a cold cache is a permanent gap rather than a slow start.

## What it checks

It looks at every node of kind cache, and fires when:

- all of these hold:
  - the node's `materialised` is true
  - this does not hold:
    - the node has at least one incoming edge from a sql-database, nosql-database, worker or stream

Message template:

```
Cache '{{node.id}}' holds materialised data but nothing durable or no worker feeds it. It cannot be rebuilt after loss.
```

## Applies to

- [Cache](https://localhost:3000/catalogue/kinds/cache.md) `cache`

37 catalogue components fall under it.

## Tripped by

Reference designs whose broken twin names this rule in its header:

- [cloudflare-edge](https://localhost:3000/d/zeema/cloudflare-edge)
- [etsy-search](https://localhost:3000/d/zeema/etsy-search)
- [google-maps](https://localhost:3000/d/zeema/google-maps)
- [hotel-reservation](https://localhost:3000/d/zeema/hotel-reservation)
- [khan-academy-goliath](https://localhost:3000/d/zeema/khan-academy-goliath)
- [proximity-service](https://localhost:3000/d/zeema/proximity-service)
- [reddit-feed](https://localhost:3000/d/zeema/reddit-feed)
- [tiktok-recommendation](https://localhost:3000/d/zeema/tiktok-recommendation)
- [twitter-timeline](https://localhost:3000/d/zeema/twitter-timeline)
- [wikipedia](https://localhost:3000/d/zeema/wikipedia)
- [x-recommendation](https://localhost:3000/d/zeema/x-recommendation)
- [zerodha-kite](https://localhost:3000/d/zeema/zerodha-kite)

## Source (`rule` YAML, verbatim)

```yaml
# yaml-language-server: $schema=../schema/rule.schema.json
# A cache holding materialised views (timelines, feeds, precomputed lists) must be rebuildable
# from a durable source or a worker. With no such in-edge, a cold cache is a permanent gap.
# Tripped by: designs/twitter-timeline.broken.yaml
schemaVersion: "1"
type: "rule"
id: "materialised-cache-without-rebuild-path"
severity: "error"
select:
  node:
    kind: "cache"
when:
  all:
    - prop: "materialised"
      equals: true
    - not:
        hasEdge:
          direction: "in"
          peerKind: ["sql-database", "nosql-database", "worker", "stream"]
message: "Cache '{{node.id}}' holds materialised data but nothing durable or no worker feeds it. It cannot be rebuilt after loss."
```

Human page: https://localhost:3000/catalogue/rules/materialised-cache-without-rebuild-path
