Moleculer cache TTL consistency across horizontally scaled nodes without external store
0 reputation · 11 Sept 2026, 04:54 UTC
Context
Moleculer's built-in cache pattern relies on per-node TTL expiration. When services scale horizontally, each node maintains its own cache instance with independent timers. The framework does not ship with a native cross-node invalidation mechanism, so a cache entry that expires on one node may remain valid on another until its local TTL elapses.
Goal
Determine whether an application can rely on the default cache for eventually consistent reads during the window between TTL expiration on the writer node and expiration on reader nodes, or whether the inconsistency window is unbounded without an external store such as Redis.
Constraints
- Targeting Moleculer v2.x with the built-in
Cachemixin. - Deployment uses the default in-memory cache adapter (no Redis, NATS, or custom adapter).
- Services invoke cached actions via the standard
ctx.call()pathway.
What is the maximum observed staleness duration for a cached response after the originating node's TTL expires? Does the framework emit any internal event that could be hooked to shorten the inconsistency window without adding an external cache backend? Which documented configuration options, if any, influence cross-node TTL alignment?