Which cache engine to choose between redis or memcached and varnish.

simo97 profile image ADONIS SIMO ・1 min read

Hi mates, my team and i are building a web platform (Social network and Ecommerce), and we are are planning to receive a lot of traffic and i want to know which caching system will be the best between varnish, redis and memcached ? Varnish act like a load balancer (from what i read) is it a good idea to use it ?


markdown guide

Redis has more features, and, IME, isn't any slower. So I'd use it instead of Memcached.

Varnish isn't comparable to the other two. Redis and Memcached are used by your application to cache chunks of data, while Varnish uses your application to generate entire web pages and caches them.


Oh this mean i can use Varnish and one of the others... like a frontend (varnish) cache and a backend cache (redis or memcached). Thank you


Depends on what a microservice would use it for.


PS. with Varnish, make sure that your application will set correct http headers. Playing with login users, their personal data, a miss configured varnish and responding very generic in the http headers, you'll possible expose a lot of personal data between logged in users...