Skip to content

Instantly share code, notes, and snippets.

@Integralist
Last active February 7, 2024 13:56
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save Integralist/9c87172cb418e539dae0 to your computer and use it in GitHub Desktop.
Save Integralist/9c87172cb418e539dae0 to your computer and use it in GitHub Desktop.
Redis vs Memcache

When deciding between Memcached and Redis, here are a few questions to consider:

  • Is object caching your primary goal, for example to offload your database? If so, use Memcached.
  • Are you interested in as simple a caching model as possible? If so, use Memcached.
  • Are you planning on running large cache nodes, and require multithreaded performance with utilization of multiple cores? If so, use Memcached.
  • Do you want the ability to scale your cache horizontally as you grow? If so, use Memcached.
  • Does your app need to atomically increment or decrement counters? If so, use either Redis or Memcached.
  • Are you looking for more advanced data types, such as lists, hashes, and sets? If so, use Redis.
  • Does sorting and ranking datasets in memory help you, such as with leaderboards? If so, use Redis.
  • Are publish and subscribe (pub/sub) capabilities of use to your application? If so, use Redis.
  • Is persistence of your key store important? If so, use Redis.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment