Replies: 2 comments 6 replies
-
Hi @jmwnoble and thanks for using FusionCache, and for your words 🙂 NOTE: after more thoughts, I've update my answer to avoid future readers getting the wrong take, sorry for the first (incomplete/wrong) answer.
Ok so if I got this right, each region has its own API instances running + a Redis instance, and all of them talk to a unique, central database.
Ok, good so far.
Ok, still good.
Correct: even though you can use Redis as a distributed cache and Redis as the backplane (both as the same Redis instance or a different one), the 2 things are not connected whatsoever: the 2nd level cache uses the key/value store part, and the backplane uses the pub/sub part, and they are completely disconnected. The pub/sub part is simply a way to send messages, which are not related at all with cache entries or cache keys (the messages just happen to contain a field that specifies on which cache keys to act, but they are not strictly connected).
Ah, damn it. In this very particular scenario you are right! I'd like to expand a little bit here just to write things down, and to be sure we are on the same page. The problem comes when considering that each US (API) node will invalidate their own local memory cache but NOT the shared cache in the US Redis instance. To be even more clear, here's a quick simplified flow of what would happen:
So yeah, you got a point here I think 🤔
Makes sense. The caching architecture you have in mind seems like an interesting one to explore.
Yep, and I'll see if I find a way to make it work.
Give me a little bit of time to explore the scenario, will get back to you as soon as possible.
Thanks to you for being involved in the community! |
Beta Was this translation helpful? Give feedback.
-
Also, about this passage:
If this central service doesn't care about getting or setting data from the cache, but only sending notifications, I may be thinking about something... let me know if this is your case. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hi and thank you so much for this great library. I have an approach I want to test out, and want to sense-check it here:
Our scenario:
Our plan to manage cache validity:
The other option we are considering is a multi-region redis cluster, but that has cost and complexity implications that make it unattractive, especially given we have a read-through cache architecture (ie GetSet) where the data in each region is generally different.
Does this sound like a reasonable approach? Anything you would do differently? I know this is similar to other backplan discussions but in our case we absolutely what all three features (1st, 2nd, backplane), just need to manage it across regions.
Many thanks
Jeremy
Beta Was this translation helpful? Give feedback.
All reactions