Memcached vs Varnish: What are the differences?
What is Memcached? High-performance, distributed memory object caching system. Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.
What is Varnish? High-performance HTTP accelerator. Varnish Cache is a web application accelerator also known as a caching HTTP reverse proxy. You install it in front of any server that speaks HTTP and configure it to cache the contents. Varnish Cache is really, really fast. It typically speeds up delivery with a factor of 300 - 1000x, depending on your architecture.
Memcached and Varnish are primarily classified as "Databases" and "Web Cache" tools respectively.
"Fast object cache", "High-performance" and "Stable" are the key factors why developers consider Memcached; whereas "High-performance", "Very Fast" and "Very Stable" are the primary reasons why Varnish is favored.
Memcached and Varnish are both open source tools. It seems that Memcached with 9K GitHub stars and 2.6K forks on GitHub has more adoption than Varnish with 908 GitHub stars and 216 GitHub forks.
According to the StackShare community, Varnish has a broader approval, being mentioned in 1006 company stacks & 140 developers stacks; compared to Memcached, which is listed in 756 company stacks and 268 developer stacks.
What is Memcached?
What is Varnish?
Need advice about which tool to choose?Ask the StackShare community!
Sign up to add, upvote and see more prosMake informed product decisions
What are the cons of using Memcached?
What are the cons of using Varnish?
Sign up to get full access to all the companiesMake informed product decisions
Sign up to get full access to all the tool integrationsMake informed product decisions
When you visit the site, you talk to a load balancer which chooses a varnish front-end which in turn talks to our web front-ends which used to run nine python processes. Each of these processes are serving the exact same version on any given web front-end.
Varnish sits as a secondary cache layer behind Akamai. Two servers operate in a Primary/Secondary configuration with failover managed by HAProxy. Requests peak at around 10k/s.
As part of the cacheing system within Drupal.
Memcached mainly took care of creating and rebuilding the REST API cache once changes had been made within Drupal.
Distributed cache exposed through Google App Engine APIs; use to stage fresh data (incoming and recently processed) for faster access in data processing pipeline.
Memcache caches database results and articles, reducing overall DB load and allowing seamless DB maintenance during quiet periods.
Varnish is the http cache proxy we use to achieve maximum performance on high traffic e-commerce.
Used to cache most used files for our clients. Connected with CloudFlare Railgun Optimizer.