Redis › Redis vs Memcached
How do the threading models of Redis and Memcached differ, and what performance implications does this have?
IntermediateAnswer
Redis primarily processes commands using a single main thread, relying on an efficient event driven model to handle many connections, while Memcached uses a genuinely multi threaded architecture that can take advantage of multiple processor cores simultaneously for handling many simple get and set operations, which can give Memcached an edge in raw throughput for very simple, high volume caching workloads specifically.
-- Memcached can use multiple threads and cores
-- for simple get and set operations simultaneously
memcached -t 4 -- run with 4 threadsReal-world example A team running a very high volume, extremely simple caching workload with basic key value pairs benchmarks both options, finding Memcached's multi threaded design provides a modest throughput advantage for their specific simple use case.