FusionCache
FusionCache copied to clipboard
Support for External Cache Invalidation Across Microservices
Hi, first of all, thanks for this awesome library!
I’m working on a system that has two microservices: A and B.
- Microservice A is the source of truth for a certain entity.
- Microservice B reads that entity from A and caches it using FusionCache.
- Microservice A also uses FusionCache — but it does not cache this particular entity.
- We want B to cache it for performance reasons.
Here’s the challenge:
When data is updated or deleted in microservice A, we want the cached version in microservice B to be invalidated as well.
Since both services are using FusionCache (even though A doesn’t cache this entity), is there a way to trigger a cache invalidation in B via a Backplane mechanism (like Redis or anything else), from A?
I was thinking of using Redis Pub/Sub or a custom webhook from A to B to manually call .Remove() in B — but I wonder if FusionCache’s Backplane could help automatically propagate invalidations across services?
Would love your input on the best way to handle this with FusionCache. Thanks a lot 🙏