由于工作中要开发一个分布式限速服务,方案中会用到分布式缓存或者分布式in-memory的key-value存储,这是一个比较大的方向,所以单独在这里开一个专题(专业给自己挖坑,慢慢填吧。。)
分布式缓存主要考虑几个问题
- 数据均衡性
- 分区容忍行
- 扩缩容
数据均衡性
取决于分区算法
分区算法需要满足:
- 平横性:主要是数据的平均分布,及当集群中某一个缓存服务失效,数据也能够正常分布
- 单调性:当数据插入某个缓存之后,再次调用,同样会落到对应的缓存上面。
常见的算法有:
- Consistent Hash ()
- HRW (https://en.wikipedia.org/wiki/Rendezvous_hashing)
In-Memory Data Grid
reference:
- https://medium.com/car2godevs/in-memory-distributed-data-structures-for-the-masses-c6627664474a
- (apache arrow)[https://arrow.apache.org/]
- (JSP107,CACHE-API)https://download.oracle.com/otndocs/jcp/jcache-1_0-fr-eval-spec/index.html
- (hazelcast)[https://docs.hazelcast.org/docs/latest-dev/manual/html-single/]
- (redis-cluster)[https://redis.io/topics/cluster-spec]
- (grid-gain)[https://blog.csdn.net/dc_726/article/details/42615299]
- (ignite)[https://github.com/apache/ignite]
- (aerospike)[https://en.wikipedia.org/wiki/Aerospike_(database)]
- (HRW hash)[https://en.wikipedia.org/wiki/Rendezvous_hashing]
- (TiKV)[https://github.com/tikv/tikv]
- (Top15 imdg)[https://www.predictiveanalyticstoday.com/top-memory-data-grid-applications/]
- (Alluxio)[https://www.alluxio.org/]