ZiggyCreatures / FusionCache

FusionCache is an easy to use, fast and robust hybrid cache with advanced resiliency features.
MIT License
1.92k stars 97 forks source link

Question : How are cache invalidations handled? #32

Closed MartyBJones closed 2 years ago

MartyBJones commented 3 years ago

Say I have a web application running on 4 servers that uses FusionCache with a Redis secondary cache and I remove a cache entry from one of the web applications. It looks like the local FusionCache will be removed and the Redis secondary cache will have it's entry removed but how will the other 3 servers know to clear their FusionCache entries?

jodydonetti commented 3 years ago

Hi @MartyBJones , thanks for considering FusionCache.

The scenario you are talking about is an example of why I'm working on adding a backplane (see #11), which I hope will be available soon. Btw you caught me working on it right at this very moment πŸ˜…

Another approach which would give similar results is to have a very low memory cache duration along with a higher distributed cache duration (like requested in #30) to highly reduce the differences between the memory and the distributed cache.

MartyBJones commented 3 years ago

The backplane sounds promising! I look forward to trying it out!

On Fri, Nov 5, 2021 at 4:10 PM Jody Donetti @.***> wrote:

Hi @MartyBJones https://github.com/MartyBJones , thanks for considering FusionCache.

The scenario you are talking about is an example of why I'm working on adding a backplane (see #11 https://github.com/jodydonetti/ZiggyCreatures.FusionCache/issues/11), which I hope will be available soon. Btw you caught me working on it right at this very moment πŸ˜…

Another approach which would give similar results is to have a very low memory cache duration along with a higher distributed cache duration (like requested in #30 https://github.com/jodydonetti/ZiggyCreatures.FusionCache/issues/30) to highly reduce the differences between the memory and the distributed cache.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jodydonetti/ZiggyCreatures.FusionCache/issues/32#issuecomment-962222044, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA562VXK4IE3M76ELWPAVRDUKRB4DANCNFSM5HOV4C2A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

jodydonetti commented 2 years ago

Hi @MartyBJones , I'm happy to say that I've finally been able to complete the design and implementation of the backplane feature.

Please take a look here, try it out and let me know what you think so I can move forward with the final version.

Thanks πŸ™

πŸ“¦ It's a pre-release!

Note that the Nuget package is marked as pre-release so please be sure to enable the related filter otherwise you would not see them:

image

MartyBJones commented 2 years ago

That is great news! I will try to look at it sometime next week.

On Thu, Jan 27, 2022 at 3:39 PM Jody Donetti @.***> wrote:

Hi @MartyBJones https://github.com/MartyBJones , I'm happy to say that I've finally been able to complete the design and implementation of the backplane feature.

Please take a look here https://github.com/jodydonetti/ZiggyCreatures.FusionCache/releases/tag/v0.1.10-alpha1, try it out and let me know what you think so I can move forward with the final version.

Thanks πŸ™

β€” Reply to this email directly, view it on GitHub https://github.com/jodydonetti/ZiggyCreatures.FusionCache/issues/32#issuecomment-1023662634, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA562VX5FOR6OIAUK5TWDIDUYG3QZANCNFSM5HOV4C2A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

jodydonetti commented 2 years ago

Meanwhile I published an (hopefully) even better alpha2 release.

jodydonetti commented 2 years ago

Hi all, just wanted to update you on the next version: I released right now the BETA2 for the next big release, which includes among other small things a big fix for the DI setup part.

This will probably be the last release before the official one.

jodydonetti commented 2 years ago

Hi all, yesterday I released the BETA 3.

Unless some big problem comes up, this will be the very last release before the official one, which will be in the next few days πŸŽ‰

jodydonetti commented 2 years ago

Closing this since with v0.9.0 the backplane is an official feature, with official docs and more.

MartyBJones commented 2 years ago

Jody, have you don’t any performance metrics on the new backplane? Just wondering how many notifications it can handle.

On Tue, Feb 15, 2022 at 3:54 PM Jody Donetti @.***> wrote:

Hi all, yesterday I released the BETA 3 https://github.com/jodydonetti/ZiggyCreatures.FusionCache/releases/tag/v0.1.10-beta3 .

Unless some big problem comes up, this will be the very last release before the official one, which will be in the next few days πŸŽ‰

β€” Reply to this email directly, view it on GitHub https://github.com/jodydonetti/ZiggyCreatures.FusionCache/issues/32#issuecomment-1040833950, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA562VQC7OARR44KHBQWCWTU3LDSFANCNFSM5HOV4C2A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

jodydonetti commented 2 years ago

Hi @MartyBJones , there are no intrinsic limits on how many notifications it can handle, it wholly depends on the underlying pub/sub mechanism used.

For example using the common Redis implementation on, say, an Azure Redis Cache instance will be subjected to the limits of that infrastructure and the Redis internal limits themselves (some of which you can see here).

In general I haven't found any particular bottlenecks or problems in general regarding the pub/sub part (which is what is used in the backplane), but I don't have precise number yet.