Caching layer for different microservices

2019-08-26 22:09发布

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条回答
霸刀☆藐视天下
2楼-- · 2019-08-26 22:59

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).

查看更多
登录 后发表回答