How do you choose between Memcached, Redis and Varnish?

Robin picture Robin · Mar 1, 2014 · Viewed 17k times · Source

I am really very confused about Memcached, Redis and Varnish. I know they are used for caching, but I don't know how much they help, and how you know which one to use.

And lastly, I would like know what you would use for a site with user-uploaded pictures and videos? If it helps I am using the Django framework.

Answer

Mohammad AbuShady picture Mohammad AbuShady · Mar 2, 2014

Varnish is the odd one out, it's a server that runs as a reverse proxy in front of the real webserver (apache, nginx, etc.) and it stores the response of the server separately and could decide to serve it for a subsequent request without passing the request to the backend (the webserver), so simply it's like HTML caching.

Memcached and redis are actually data storage servers, specifically key-value storage servers. In terms of python you could say it's one huge 'dictionary', you set values with a key and retrieve them by key. There's few differences between both of them, you can simply Google memcached vs redis.