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 ?
I think you have many options:
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).