Sheet 10

Cache Architecture (Redis Cluster)

In-memory working set sizing: active user sessions, full catalog entries, hot SKUs, and shard allocations.

Cluster Memory9 GB (3 Shards)
Session Tokens RAM
2.86 GB
2M DAU × 1.5 KB
Catalog Metadata
1.43 GB
500k SKUs × 3 KB
Hot SKUs Cache
0.10 GB
100k hot items × 1 KB
With 1.3x Overhead
5.70 GB
jemalloc + dict overhead

Redis Cluster Sizing & Throughput Math

1. Peak Cache Operations / sec

Peak_RPS × QUERIES_PER_API_CALL

2. Cache Hit Operations

Cache_Ops × (CACHE_HIT_PCT / 100)

19,000 ops/s (95%)
3. Primary Master Shards

MAX(3, CEIL(Ops / 100k_per_node))

4. Eviction Policy

volatile-lru with explicit TTLs on session tokens

volatile-lru