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.
Redis uses a single core and shows better performance than Memcached in storing small datasets when measured in terms of cores. Memcached implements a multi-threaded architecture by utilizing multiple cores. Therefore, for storing larger datasets, Memcached can perform better than Redis.
That being said, the primary difference is that Redis is a key => value store that stores the value of X to a defined key, whereas Varnish is a web application accelerator / caching HTTP reverse proxy. While both provide caching, they both perform entirely different tasks.
When storing data, Redis stores data as specific data types, whereas Memcached only stores data as strings. Because of this, Redis can change data in place without having to re-upload the entire data value. This reduces network overhead.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With