Solving Tricky Coordination Problems in Stateless .NET Services
summary
Shows a concrete solution to cache stampedes: use Redis Pub/Sub plus a short-lived distributed lock (SET NX with expiry) so one instance computes a heavy result, publishes a notification, and waiting instances return the cached value instead of duplicating work. Provides an ASP.NET Core demo using IDistributedCache, async code and System.Collections.Concurrent, plus C# and Go implementations on GitHub (MemoryOak/redis-memo). Includes externally managed jobs, timeouts and lease semantics; demo proves only one computation runs and others receive the result via pub/sub.
AI-written summary · about
chapters (9)
- 0:00Start
- 0:46Inter-Service Communication
- 17:13Cache Stampede
- 18:49Concurrency Locks
- 26:42Redis
- 29:56Code and Demo
- 31:25Usage Interface
- 36:17Get Resource
- 38:20Set Up a Notification
related talks
58mWelcome to the (state) machine
51mDealing with eventual consistency
39mDealing with eventual consistency
53mDurable Execution With Restate
34mCaching Entire Systems without Invalidation
50mAn Introduction to CQRS and Event Sourcing Patterns
54mWhere we're going... we don't need batch jobs
31mWriting Reliable, Scalable, Fault Oblivious Code On K8s the Easy Way
