Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ScalingRedisAndMemcachedAtWayfair.pdf

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →
Avatar for Ben Clark Ben Clark
November 12, 2014

 ScalingRedisAndMemcachedAtWayfair.pdf

This is a talk I gave at Facebook's Data@Scale Boston in November 2014. Here's the talk on Youtube: https://www.youtube.com/watch?v=oLjryfUZPXU, and the accompanying blog post: http://engineering.wayfair.com/scaling-redis-and-memcached-at-wayfair/

Avatar for Ben Clark

Ben Clark

November 12, 2014

Other Decks in Technology

Transcript

  1. Background  Caching  Key-value stores  Consistent hashing at

    Akamai and after Scaling KV stores in the industry  Redis cluster  Talks, blogs, code by Instagram, Pinterest, Facebook, Twitter Scaling Redis and Memcached at Wayfair
  2. 6 Caching keys: web server, DB, cache Because the best

    database query is no query at all. Why and what?
  3. 8 Consistent hashing, 1997-present Diagram from MIT paper, 1997 Keys

    {1,2,3} on server A, {4,5} on B Wayfair MC cluster, 2013 Down a server, and the right keys migrate
  4. 11 Composite caching systems in the industry Company Components (not

    comprehensive) Instagram Redis, ketama Pinterest Redis, ZooKeeper, S3 Facebook mcrouter proxying to Memcached, Tao
  5. 12 Twitter’s forks and proxies Twemproxy as applied to a

    Wayfair web server: PHP-MC|Redis connections / 50 Before After
  6. 19 Tools we used, tools we hacked Stock tools Written

    or modified by us Memcached 1.4 Ketama (RJ) Redis 2.6 Twemproxy (Twitter) ZooKeeper 3.4.5 php-pecl-memcache Kazoo 1.2 (ZK client) zk_failover Phpredis, ‘redis’ on PyPI >=2.7 Utilities, wrapper classes, scripts, etc.
  7. 21 TODO list • Hot keys (load balancing for the

    same key), mcrouter or Riak style • Faster Redis failover.
  8. 22 References • “Scaling Redis at Twitter”, great talk in

    July 2014 by Yao Yu (@thinkingfish): https://www.youtube.com/watch?v=rP9EKvWt0zo • Opensourcing of mcrouter, September 2014: https://code.facebook.com/posts/296442737213493/introducing-mcrouter-a- memcached-protocol-router-for-scaling-memcached-deployments/ • Redis at Pinterest: http://blog.pivotal.io/pivotal/case-studies-2/using-redis-at- pinterest-for-billions-of-relationships • Mike Krieger of Instagram at atscale, Storage Systems at a Rapidly Scaling Startup with a Small Team - Data@Scale”: https://www.youtube.com/watch?v=bLyv8zKa5DU • https://github.com/reddit/zookeeper.dsc/blob/master/src/contrib/zkpython/src/p ython/zk.py • github.com/wayfair/ketama (fork of RJ/ketama) • Details on part of this talk: http://engineering.wayfair.com/consistent-hashing- with-memcached-or-redis-and-a-patch-to-libketama/