Caching layer for different microservices

怎甘沉沦 提交于 2019-12-11 17:24:02

问题


We have different microservices which makes duplicate calls to internal and external services. We need to cache these calls between services to improve latency. We are thinking of introducing an API gateway whose major aim would be caching the data between services. Some other objectives are -

i) Would be calling different micro-services to aggregate their response.

ii) Would also be avoiding multiple calls to external services across micro services.

iii) Would be taking care of cache miss & hit for external API calls.

iv) High throughput, performance and low latency.

We have vert.x based tech stack. What would be the best way to implement such a system. I had following questions -

1) Implement it as a library or a service ?

2) Which data store to be used ( we are considering Redis/Hazelcast) ?

3) Can libraries such as Varnish/Squid/Nginx help here ?

4) How to handle cache invalidation ?


回答1:


I think you have many options:

  1. Redis
  2. Redis Sentinel (support clustering)
  3. ETCD (from CoreOS) : Support Clustering
  4. Apache Geode
  5. Aerospike : Support clustering even between data centers

and many commercial products like SAP HANA.

note : Aerospike is free but for clustering between data centers I think you should pay.

I myself have used ETCD for same scenarios (thanks to Brandon Philips).



来源:https://stackoverflow.com/questions/44265295/caching-layer-for-different-microservices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!