What is the difference between 2nd level option and backplane, when using distributed cache? #64
-
hi, I would like to understand the difference between using the 2nd level option (of using a distributed cache) and Backplane with distributed cache? Somehow both of them looks same to me. How are they different? Also, for distributed cache, you mention that any backend that supports IDistributedCache can be used. However for backplane, only Redis is supported, not the others which support IDistributedCache. Why is that? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi @askids and thanks for considering FusionCache!
I'll try to do my best to dissect the 2 levels and the backplane for you: keep in mind that most points are valid in every scenario, but some are related (or more relevant) to a multi-node scenario. The 1st level cache is an in-memory store and:
Also, being local to the machine it is running, it does not suffer from the fallacies of distributed computing. The 2nd level cache is an out-of-memory store (and typically distributed, as in running on one or more other machines) and:
Both of these are cache layers, which means they are store (as in, places where the data is stored) and the idea is that combining both you get the best of both worlds:
Now the only remaining problem is that sometimes you may have data inside each nodes' 1st layer that is not in-synch with other nodes' 1st layers, based on when some data have been requested. Here is when the backplane enters the scene. In fact the backplane is not a store (like the 2 layers) but it is a message bus onto which FusionCache sends messages to notify the other nodes about changes, so that each time something changes all the other nodes can be notified so everything remains synchronized everywhere all the times (automatically).
Exactly! All the available implementations can be found here in the Packages section.
Because the backplane needs to be able to send and receive messages (think pub/sub) and the In practice this means that I have to code a backplane implementation for every possible system out there that does have a pub/sub mechanism (since there's no In closing I'd like to suggest a couple of readings, like the Backplane doc itself and, if you have some time, the Step By Step one which is long (so grab a cup of coffee) but I think may be a good way to go one step at a time and understand each piece of the puzzle and what results it can get you. Hope this helps, if you have any question let me know! |
Beta Was this translation helpful? Give feedback.
-
@jodydonetti thanks for explaining in detail. I will take a look at the step by step guide in details. One unrelated question. Theoretically, can this implementation be extended to synchronize multiple Redis clusters across multiple data centers instead of typical single cluster on one data center? |
Beta Was this translation helpful? Give feedback.
Hi @askids and thanks for considering FusionCache!
I'll try to do my best to dissect the 2 levels and the backplane for you: keep in mind that most points are valid in every scenario, but some are related (or more relevant) to a multi-node scenario.
The 1st level cache is an in-memory store and:
But: