Background
When it comes to distributed caching, the first thing you think about is memcached. Indeed, Memcached is one of the most popular options at the moment. But many internet companies don't have to memcached, like new eggs. Why not choose memcached, hit rate? Hot-swappable? or performance. Here we should not put the conclusion and speak with the facts.
Algorithm-1. Remainder method
If you have an old version of the Memcache official document on hand. You will find that they are using the Yufarai to maintain the consistency of the nodes. If you have n cache servers, you need to set an object into a node. With the hash to take the mold so that you can very evenly ensure that each load. So, as the most basic polling algorithm, is suitable for distributed caching we look at the example.
This assumes that there are 4 cache nodes, first set the redundancy scheme.
999 key values are automatically set.
Here's a look at the overall results of the solution
This article URL address: http://www.bianceng.cn/Programming/csharp/201410/45481.htm