---
id: "cache"
type: "kind"
category: "data"
url: "https://localhost:3000/catalogue/kinds/cache"
---

# Cache

In-memory key-value store placed in front of a slower datastore.

| | |
|---|---|
| Category | Data |
| Properties | 14 |
| Components | 37 |
| Rules | 3 |

## Properties

| property | type | values | required | default |
|---|---|---|---|---|
| `evictionPolicy` | enum | `lru`, `lfu`, `ttl`, `none` | no | — |
| `hashing` (advanced) | enum | `none`, `consistent` | no | "none" |
| `invalidation` | enum | `ttl`, `event`, `none` | no | "ttl" |
| `managed` | boolean | — | no | false |
| `materialised` (advanced) | boolean | — | no | false |
| `persistence` | boolean | — | no | false |
| `readBarrier` (advanced) | boolean | — | no | false |
| `replication` | enum | `none`, `single-az`, `multi-az`, `multi-region` | no | "none" |
| `shards` | integer | — | no | — |
| `structure` (advanced) | enum | `key-value`, `bloom-filter`, `hash-set`, `sorted-set` | no | "key-value" |
| `tier` (advanced) | enum | `core`, `edge` | no | "core" |
| `ttlJitter` (advanced) | boolean | — | no | false |
| `ttlSeconds` | integer | — | no | — |
| `usedAsPrimaryStore` (advanced) | boolean | — | no | false |

## Rules for this kind · 3

### Cache used as primary store without persistence `cache-as-primary-store-without-persistence` (error)

- Page: https://localhost:3000/catalogue/rules/cache-as-primary-store-without-persistence.md
- Why: This cache is the only copy of its data and has persistence turned off. A restart loses the data outright.
- Applies to: every node of kind cache
- Message: Cache '{{node.id}}' is the primary store for its data but has persistence disabled.

It fires when:

- all of these hold:
  - the node's `usedAsPrimaryStore` is true
  - the node's `persistence` is false

### Cache without eviction policy `cache-missing-eviction-policy` (warning)

- Page: https://localhost:3000/catalogue/rules/cache-missing-eviction-policy.md
- Why: A cache with no declared eviction policy inherits whatever the vendor chose, and most vendors default to evicting nothing. The cache fills up and then starts refusing writes.
- Applies to: every node of kind cache
- Message: Cache '{{node.id}}' has no eviction policy. Declare lru, lfu or ttl, or justify none explicitly.

It fires when:

- any of these hold:
  - the node's `evictionPolicy` has no value
  - the node's `evictionPolicy` is "none"

### Materialised cache without a rebuild path `materialised-cache-without-rebuild-path` (error)

- Page: https://localhost:3000/catalogue/rules/materialised-cache-without-rebuild-path.md
- 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.
- Applies to: every node of kind cache
- Message: Cache '{{node.id}}' holds materialised data but nothing durable or no worker feeds it. It cannot be rebuilt after loss.

It 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

## Components · 37

### vendor-neutral

- [Generic cache](https://localhost:3000/catalogue/components/cache.md) `cache` — the kind itself

### alibabacloud

- [ApsaraDB for Memcache](https://localhost:3000/catalogue/components/alibaba-apsaradb-memcache.md) `alibaba-apsaradb-memcache` — 4 defaults
- [ApsaraDB for Redis](https://localhost:3000/catalogue/components/alibaba-apsaradb-redis.md) `alibaba-apsaradb-redis` — 4 defaults

### aws

- [Amazon DynamoDB Accelerator (DAX)](https://localhost:3000/catalogue/components/aws-dax.md) `aws-dax` — 7 defaults
- [Amazon ElastiCache](https://localhost:3000/catalogue/components/aws-elasticache.md) `aws-elasticache` — 5 defaults
- [Amazon MemoryDB](https://localhost:3000/catalogue/components/aws-memorydb.md) `aws-memorydb` — 6 defaults

### azure

- [Azure Cache for Redis](https://localhost:3000/catalogue/components/azure-cache-for-redis.md) `azure-cache-for-redis` — 3 defaults
- [Azure Managed Redis](https://localhost:3000/catalogue/components/azure-managed-redis.md) `azure-managed-redis` — 3 defaults

### default

- [Cache cluster](https://localhost:3000/catalogue/components/cache-cluster.md) `cache-cluster` — 1 defaults
- [cognee](https://localhost:3000/catalogue/components/cognee.md) `cognee` — 2 defaults
- [Dragonfly](https://localhost:3000/catalogue/components/dragonfly.md) `dragonfly` — 1 defaults
- [EVCache](https://localhost:3000/catalogue/components/evcache.md) `evcache` — 4 defaults
- [Microsoft Garnet](https://localhost:3000/catalogue/components/garnet.md) `garnet` — 1 defaults
- [VMware GemFire](https://localhost:3000/catalogue/components/gemfire.md) `gemfire` — 5 defaults
- [Graphiti](https://localhost:3000/catalogue/components/graphiti.md) `graphiti` — 3 defaults
- [Hazelcast](https://localhost:3000/catalogue/components/hazelcast.md) `hazelcast` — 3 defaults
- [Apache Ignite](https://localhost:3000/catalogue/components/ignite.md) `ignite` — 3 defaults
- [Infinispan](https://localhost:3000/catalogue/components/infinispan.md) `infinispan` — 2 defaults
- [KeyDB](https://localhost:3000/catalogue/components/keydb.md) `keydb` — 1 defaults
- [Letta](https://localhost:3000/catalogue/components/letta.md) `letta` — 3 defaults
- [Mem0](https://localhost:3000/catalogue/components/mem0.md) `mem0` — 3 defaults
- [Memcached](https://localhost:3000/catalogue/components/memcached.md) `memcached` — 4 defaults
- [Redis](https://localhost:3000/catalogue/components/redis.md) `redis` — 1 defaults
- [Redis Cloud](https://localhost:3000/catalogue/components/redis-cloud.md) `redis-cloud` — 1 defaults
- [Squid](https://localhost:3000/catalogue/components/squid.md) `squid` — 3 defaults
- [Trickster](https://localhost:3000/catalogue/components/trickster.md) `trickster` — 6 defaults
- [Upstash Redis](https://localhost:3000/catalogue/components/upstash.md) `upstash` — 2 defaults
- [Valkey](https://localhost:3000/catalogue/components/valkey.md) `valkey` — 1 defaults
- [Varnish Cache](https://localhost:3000/catalogue/components/varnish.md) `varnish` — 4 defaults
- [Zep](https://localhost:3000/catalogue/components/zep.md) `zep` — 3 defaults

### gcp

- [Memorystore for Redis](https://localhost:3000/catalogue/components/google-memorystore.md) `google-memorystore` — 5 defaults
- [Memorystore for Memcached](https://localhost:3000/catalogue/components/google-memorystore-memcached.md) `google-memorystore-memcached` — 5 defaults
- [Memorystore for Redis Cluster](https://localhost:3000/catalogue/components/google-memorystore-redis-cluster.md) `google-memorystore-redis-cluster` — 5 defaults
- [Memorystore for Valkey](https://localhost:3000/catalogue/components/google-memorystore-valkey.md) `google-memorystore-valkey` — 5 defaults

### ibm

- [IBM Cloud Databases for Redis](https://localhost:3000/catalogue/components/ibm-databases-for-redis.md) `ibm-databases-for-redis` — 2 defaults

### oci

- [OCI Cache with Redis](https://localhost:3000/catalogue/components/oci-cache-redis.md) `oci-cache-redis` — 3 defaults
- [OCI Cache with Valkey](https://localhost:3000/catalogue/components/oci-cache-valkey.md) `oci-cache-valkey` — 3 defaults

## Source (`kind` YAML, verbatim)

```yaml
# yaml-language-server: $schema=../schema/kind.schema.json
# In-memory key-value store placed in front of a slower datastore.
# evictionPolicy is deliberately optional with no default; cache-missing-eviction-policy reports its absence.
# shards counts the identical shards of one cache; two or more draw the node as a stack.
schemaVersion: "1"
type: "kind"
id: "cache"
category: "data"
properties:
  evictionPolicy:
    type: "enum"
    values: ["lru", "lfu", "ttl", "none"]
  ttlSeconds:
    type: "integer"
  ttlJitter:
    type: "boolean"
    default: false
    advanced: true
  persistence:
    type: "boolean"
    default: false
  replication:
    type: "enum"
    values: ["none", "single-az", "multi-az", "multi-region"]
    default: "none"
  invalidation:
    type: "enum"
    values: ["ttl", "event", "none"]
    default: "ttl"
  hashing:
    type: "enum"
    values: ["none", "consistent"]
    default: "none"
    advanced: true
  usedAsPrimaryStore:
    type: "boolean"
    default: false
    advanced: true
  materialised:
    type: "boolean"
    default: false
    advanced: true
  structure:
    type: "enum"
    values: ["key-value", "bloom-filter", "hash-set", "sorted-set"]
    default: "key-value"
    advanced: true
  readBarrier:
    type: "boolean"
    default: false
    advanced: true
  tier:
    type: "enum"
    values: ["core", "edge"]
    default: "core"
    advanced: true
  shards:
    type: "integer"
  managed:
    type: "boolean"
    default: false
```

Human page: https://localhost:3000/catalogue/kinds/cache
