DEV Community

ADONIS SIMO
ADONIS SIMO

Posted on

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

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 ?

Top comments (4)

Collapse
 
notriddle profile image
Michael "notriddle" Howell

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.

Collapse
 
simo97 profile image
ADONIS SIMO

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

Collapse
 
madalinignisca profile image
Madalin Ignisca

Depends on what a microservice would use it for.

Collapse
 
madalinignisca profile image
Madalin Ignisca

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