System Design ($200k+) · CONSISTENCY · Distributed Systems Core · 2026

Fencing Tokens vs Simple Redis TTL Distributed Lock

Quick Decision Rule: When Ensuring two workers cannot concurrently overwrite a shared storage object if Worker A pauses for a 15-second GC stop-the-world while its lock TTL expires, choose Monotonically increasing fencing token issued by the lock service and validated by the storage layer on every write.

Trigger ConditionEnsuring two workers cannot concurrently overwrite a shared storage object if Worker A pauses for a 15-second GC stop-the-world while its lock TTL expires
Recommended ChoiceMonotonically increasing fencing token issued by the lock service and validated by the storage layer on every write
Classic TrapA client-checked Redis TTL lock cannot prevent a paused process from waking up after lock expiry and issuing a stale write; the storage layer must reject lower tokens.
VerificationAudited on 2026-11-23 · Distributed Systems Core · 2026

30-SECOND DECISION TRAP CHECK · CONSISTENCY

Test your instinct

A service acquires a 10s Redis distributed lock before writing to shared object storage. Occasionally Worker A freezes in a 15s GC pause, Worker B acquires the expired lock, and Worker A wakes up and overwrites Worker B’s newer file. How do you actually prevent corruption?

Primary Engineering Documentation

Related Consistency Decision Guides