System Design Core

Model the read before choosing storage

User inbox order needs (user_id,created_at,notification_id). A cursor with time alone skips records with the same timestamp. Each index also adds storage and maintenance work.

1 / 5

Trace stale cache fills

R reads v1; W commits v2 and invalidates; R fills v1 afterward. TTL starts at fill and does not alone bound the age of a delayed value. State freshness, version publication and session routing explicitly.

2 / 5

Separate replica lag from partition ownership

A follower may miss an acknowledged write. Route or wait for the required version. Date-only partitioning concentrates current writes. Hash-by-user still permits hot users. Extra buckets distribute writes but add read fanout and merge work.

3 / 5

Tie effects to durable evidence

Transactional outbox joins the record and pending event; publication can repeat. Consumer deduplication and database effect belong in one transaction. Acknowledge afterward. An external effect needs its own idempotency contract.

4 / 5

Submit a history, not only a component list

Include index/cursor, cache key/freshness, shard owner, event ID and transaction boundary. Replay a crash and a lagging-replica read. Changing from session visibility to global immediate visibility requires stronger guarantees.

5 / 5
←/→ or click edges to navigate · ? help · N notes · F fullscreen