SlideShare a Scribd company logo
Handling Redis failover
  with ZooKeeper
        Ryan LeCompte
      BaRuCo Lightning Talk
        September 2012
Me
• Rubyist at Spreecast in San Francisco
• redis_failover, method_locator,
  synchronizable
• http://github.com/ryanlecompte
• lecompte@gmail.com
• @ryanlecompte
Typical Redis Setup
Master Dies
    :-(
What happens to your data and
connected clients?

•   Resque Jobs?

•   Sidekiq Jobs?

•   Cached pages?

•   Cached stats?

•   Rubygems?
Scramble to manually
reconfigure slave as master
Update all Redis clients to
talk to the new master
Restart production services
so they can see the new config
What do we really
  want to do?
   NOTHING
Failover should be safe
    and automatic
Let’s talk about
ZooKeeper
Open source Apache
Project (originally from
        Yahoo)
Provides a set of simple
primitives to help you
     build powerful
distributed applications
Automatically handles
network partitions &
quorum management
Replicated, Highly
Available, Ordered,
Battle-proven
Used by Yahoo, Netflix,
 Rackspace, Hadoop,
     Neo4j, etc
How can I use
ZooKeeper in my
  architecture?
Distributed
     Configuration
(update thread pool sizes &
   other settings without
 requiring a server restart)
Distributed Locking
 (only one process should be
able to do something at a time)
Priority Queues
Leader Election, Group
 Membership & more
Practical application:
Using ZooKeeper to
  build automatic
  failover for Redis
redis_failover
http://github.com/ryanlecompte/redis_failover
Provides a smart “failover-
aware” client that wraps
existing Ruby client for
Redis
Clients automatically
connect to ZooKeeper
and register for watch
notifications
Node Managers monitor
Redis servers for availability
and automatically inform
clients of failover via
ZooKeeper
Architecture
RedisFailover::Client
                Example
# create new client with list of ZooKeeper servers
client = RedisFailover::Client.new(:zkservers => 'localhost:2181,localhost:
2182,localhost:2183')

# write operations automatically routed to master
client.set(‘foo’, ‘bar’)

# read operations automatically routed to a slave
client.smembers(‘data’)
Companies using
     redis_failover
• Papertrail
• Backupify
• MediaPiston
• IDT Corporation
• others
Consider incorporating
ZooKeeper into your overall
architecture.
Utilize the primitives it gives you for
solving your next distributed
programming challenge.
Don’t let your Redis servers
go unmanaged in production.
Consider using
redis_failover to sleep
better at night.
Thanks for listening!
       http://github.com/ryanlecompte/redis_failover

              Questions? Ask me at the beach!

More Related Content

PDF
Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...
PDF
Deploying Flink on Kubernetes - David Anderson
PDF
Kubernetes 101
PPTX
Apache NiFi Crash Course Intro
PDF
Java Performance Analysis on Linux with Flame Graphs
PDF
Hadoop Strata Talk - Uber, your hadoop has arrived
PPT
Docker introduction
PDF
KafkaConsumer - Decoupling Consumption and Processing for Better Resource Uti...
Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...
Deploying Flink on Kubernetes - David Anderson
Kubernetes 101
Apache NiFi Crash Course Intro
Java Performance Analysis on Linux with Flame Graphs
Hadoop Strata Talk - Uber, your hadoop has arrived
Docker introduction
KafkaConsumer - Decoupling Consumption and Processing for Better Resource Uti...

What's hot (20)

PPTX
Grokking Techtalk #40: Consistency and Availability tradeoff in database cluster
PDF
OVS Hardware Offload with TC Flower
PPTX
Using Queryable State for Fun and Profit
PPTX
Migrating your clusters and workloads from Hadoop 2 to Hadoop 3
PDF
Maxim Fateev - Beyond the Watermark- On-Demand Backfilling in Flink
PDF
Kubernetes 101 - A Cluster Operating System
PDF
RedisConf18 - Redis at LINE - 25 Billion Messages Per Day
PDF
Tadx - Présentation Conteneurisation
PDF
PDF
Docker Introduction
PPTX
[오픈소스컨설팅] Linux Network Troubleshooting
PDF
Kubernetes Deployment Tutorial | Kubernetes Tutorial For Beginners | Kubernet...
PDF
Introduction to apache spark
PDF
NiFi Developer Guide
PPTX
Kuberenetes - From Zero to Hero
PPTX
introduction to node.js
PPTX
Final terraform
PDF
Apache Iceberg Presentation for the St. Louis Big Data IDEA
PPTX
Demystifying flink memory allocation and tuning - Roshan Naik, Uber
PDF
Domain Driven Design
Grokking Techtalk #40: Consistency and Availability tradeoff in database cluster
OVS Hardware Offload with TC Flower
Using Queryable State for Fun and Profit
Migrating your clusters and workloads from Hadoop 2 to Hadoop 3
Maxim Fateev - Beyond the Watermark- On-Demand Backfilling in Flink
Kubernetes 101 - A Cluster Operating System
RedisConf18 - Redis at LINE - 25 Billion Messages Per Day
Tadx - Présentation Conteneurisation
Docker Introduction
[오픈소스컨설팅] Linux Network Troubleshooting
Kubernetes Deployment Tutorial | Kubernetes Tutorial For Beginners | Kubernet...
Introduction to apache spark
NiFi Developer Guide
Kuberenetes - From Zero to Hero
introduction to node.js
Final terraform
Apache Iceberg Presentation for the St. Louis Big Data IDEA
Demystifying flink memory allocation and tuning - Roshan Naik, Uber
Domain Driven Design
Ad

Viewers also liked (20)

PDF
Highly scalable caching service on cloud - Redis
PPTX
What's new with enterprise Redis - Leena Joshi, Redis Labs
PPTX
Introduction to Kafka and Zookeeper
PPTX
Redis Labcamp
PDF
Taming Pythons with ZooKeeper
PPTX
ZooKeeper (and other things)
PDF
ZooKeeper Futures
PDF
Apache ZooKeeper TechTuesday
PPT
Zookeeper Introduce
PDF
Taming Pythons with ZooKeeper (Pyconfi edition)
PDF
Zookeeper
PDF
Zookeeper In Action
PDF
ZooKeeper and Embedded ZooKeeper Support for IBM InfoSphere Streams V4.0
PDF
Distributed system coordination by zookeeper and introduction to kazoo python...
PDF
ZooKeeper - wait free protocol for coordinating processes
PDF
Overview of Zookeeper, Helix and Kafka (Oakjug)
PPTX
Winter is coming? Not if ZooKeeper is there!
PDF
Jcconf 2016 zookeeper
PDF
Zookeeper
PDF
Dynamic Reconfiguration of Apache ZooKeeper
Highly scalable caching service on cloud - Redis
What's new with enterprise Redis - Leena Joshi, Redis Labs
Introduction to Kafka and Zookeeper
Redis Labcamp
Taming Pythons with ZooKeeper
ZooKeeper (and other things)
ZooKeeper Futures
Apache ZooKeeper TechTuesday
Zookeeper Introduce
Taming Pythons with ZooKeeper (Pyconfi edition)
Zookeeper
Zookeeper In Action
ZooKeeper and Embedded ZooKeeper Support for IBM InfoSphere Streams V4.0
Distributed system coordination by zookeeper and introduction to kazoo python...
ZooKeeper - wait free protocol for coordinating processes
Overview of Zookeeper, Helix and Kafka (Oakjug)
Winter is coming? Not if ZooKeeper is there!
Jcconf 2016 zookeeper
Zookeeper
Dynamic Reconfiguration of Apache ZooKeeper
Ad

Similar to Handling Redis failover with ZooKeeper (20)

PDF
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
PPTX
Zookeeper Tutorial for beginners
PPTX
Zookeeper big sonata
PPTX
So we're running Apache ZooKeeper. Now What? By Camille Fournier
PPTX
Distributed Applications with Apache Zookeeper
PDF
ZooKeeper Recipes and Solutions
PDF
ZooKeeper Recipes and Solutions
PDF
ZooKeeper Recipes and Solutions
PPTX
PPTX
Apache zookeeper 101
PPTX
Redis Clustering Advanced___31Mar2025.pptx
PPTX
Leo's Notes about Apache Kafka
PDF
Tales Of The Black Knight - Keeping EverythingMe running
ODP
Coordination of Distributed Software with Redis
PDF
Introduction to ZooKeeper - TriHUG May 22, 2012
PDF
Distributed Coordination with Python
PDF
Tech Talks_25.04.15_Session 3_Tibor Sulyan_Distributed coordination with zook...
PDF
Redis: REmote DIctionary Server
PPTX
Introduction to apache zoo keeper
PDF
Redis Beyond
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
Zookeeper Tutorial for beginners
Zookeeper big sonata
So we're running Apache ZooKeeper. Now What? By Camille Fournier
Distributed Applications with Apache Zookeeper
ZooKeeper Recipes and Solutions
ZooKeeper Recipes and Solutions
ZooKeeper Recipes and Solutions
Apache zookeeper 101
Redis Clustering Advanced___31Mar2025.pptx
Leo's Notes about Apache Kafka
Tales Of The Black Knight - Keeping EverythingMe running
Coordination of Distributed Software with Redis
Introduction to ZooKeeper - TriHUG May 22, 2012
Distributed Coordination with Python
Tech Talks_25.04.15_Session 3_Tibor Sulyan_Distributed coordination with zook...
Redis: REmote DIctionary Server
Introduction to apache zoo keeper
Redis Beyond

Recently uploaded (20)

PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
Advanced Soft Computing BINUS July 2025.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
Advanced IT Governance
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Dropbox Q2 2025 Financial Results & Investor Presentation
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
NewMind AI Monthly Chronicles - July 2025
“AI and Expert System Decision Support & Business Intelligence Systems”
Per capita expenditure prediction using model stacking based on satellite ima...
The AUB Centre for AI in Media Proposal.docx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Network Security Unit 5.pdf for BCA BBA.
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
Advanced Soft Computing BINUS July 2025.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
Unlocking AI with Model Context Protocol (MCP)
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
Advanced IT Governance

Handling Redis failover with ZooKeeper

Editor's Notes