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

What's hot (20)

PDF
MariaDB 마이그레이션 - 네오클로바
NeoClova
 
PDF
Scalability, Availability & Stability Patterns
Jonas Bonér
 
PDF
MongodB Internals
Norberto Leite
 
PPTX
Introduction to Apache ZooKeeper
Saurav Haloi
 
PPTX
Apache HBase™
Prashant Gupta
 
PDF
From Generator to Fiber the Road to Coroutine in PHP
Albert Chen
 
KEY
Trees In The Database - Advanced data structures
Lorenzo Alberton
 
PPTX
Introduction to Redis
Maarten Smeets
 
PPTX
Session 14 - Hive
AnandMHadoop
 
PDF
Spark Summit EU talk by Ted Malaska
Spark Summit
 
PDF
Modern UI Development With Node.js
Ryan Anklam
 
PDF
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
luisw19
 
PDF
Etsy Activity Feeds Architecture
Dan McKinley
 
PPTX
SQL Joins.pptx
Ankit Rai
 
PDF
Redis cluster
iammutex
 
PPTX
HBase and HDFS: Understanding FileSystem Usage in HBase
enissoz
 
PDF
Building a Complex, Real-Time Data Management Application
Jonathan Katz
 
PPTX
Caching solutions with Redis
George Platon
 
PPTX
Query Optimization in SQL Server
Rajesh Gunasundaram
 
PDF
Cassandra Introduction & Features
DataStax Academy
 
MariaDB 마이그레이션 - 네오클로바
NeoClova
 
Scalability, Availability & Stability Patterns
Jonas Bonér
 
MongodB Internals
Norberto Leite
 
Introduction to Apache ZooKeeper
Saurav Haloi
 
Apache HBase™
Prashant Gupta
 
From Generator to Fiber the Road to Coroutine in PHP
Albert Chen
 
Trees In The Database - Advanced data structures
Lorenzo Alberton
 
Introduction to Redis
Maarten Smeets
 
Session 14 - Hive
AnandMHadoop
 
Spark Summit EU talk by Ted Malaska
Spark Summit
 
Modern UI Development With Node.js
Ryan Anklam
 
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
luisw19
 
Etsy Activity Feeds Architecture
Dan McKinley
 
SQL Joins.pptx
Ankit Rai
 
Redis cluster
iammutex
 
HBase and HDFS: Understanding FileSystem Usage in HBase
enissoz
 
Building a Complex, Real-Time Data Management Application
Jonathan Katz
 
Caching solutions with Redis
George Platon
 
Query Optimization in SQL Server
Rajesh Gunasundaram
 
Cassandra Introduction & Features
DataStax Academy
 

Viewers also liked (20)

PDF
Highly scalable caching service on cloud - Redis
Krishna-Kumar
 
PPTX
What's new with enterprise Redis - Leena Joshi, Redis Labs
Redis Labs
 
PPTX
Introduction to Kafka and Zookeeper
Rahul Jain
 
PPTX
Redis Labcamp
Angelo Simone Scotto
 
PDF
Taming Pythons with ZooKeeper
Jyrki Pulliainen
 
PPTX
ZooKeeper (and other things)
Jonathan Halterman
 
PDF
ZooKeeper Futures
Cloudera, Inc.
 
PDF
Apache ZooKeeper TechTuesday
Andrei Savu
 
PPT
Zookeeper Introduce
jhao niu
 
PDF
Taming Pythons with ZooKeeper (Pyconfi edition)
Jyrki Pulliainen
 
PDF
Zookeeper
ltsllc
 
PDF
Zookeeper In Action
juvenxu
 
PDF
ZooKeeper and Embedded ZooKeeper Support for IBM InfoSphere Streams V4.0
lisanl
 
PDF
Distributed system coordination by zookeeper and introduction to kazoo python...
Jimmy Lai
 
PDF
ZooKeeper - wait free protocol for coordinating processes
Julia Proskurnia
 
PDF
Overview of Zookeeper, Helix and Kafka (Oakjug)
Chris Richardson
 
PPTX
Winter is coming? Not if ZooKeeper is there!
Joydeep Banik Roy
 
PDF
Jcconf 2016 zookeeper
Matt Ho
 
PDF
Zookeeper
Geng-Dian Huang
 
PDF
Dynamic Reconfiguration of Apache ZooKeeper
DataWorks Summit
 
Highly scalable caching service on cloud - Redis
Krishna-Kumar
 
What's new with enterprise Redis - Leena Joshi, Redis Labs
Redis Labs
 
Introduction to Kafka and Zookeeper
Rahul Jain
 
Redis Labcamp
Angelo Simone Scotto
 
Taming Pythons with ZooKeeper
Jyrki Pulliainen
 
ZooKeeper (and other things)
Jonathan Halterman
 
ZooKeeper Futures
Cloudera, Inc.
 
Apache ZooKeeper TechTuesday
Andrei Savu
 
Zookeeper Introduce
jhao niu
 
Taming Pythons with ZooKeeper (Pyconfi edition)
Jyrki Pulliainen
 
Zookeeper
ltsllc
 
Zookeeper In Action
juvenxu
 
ZooKeeper and Embedded ZooKeeper Support for IBM InfoSphere Streams V4.0
lisanl
 
Distributed system coordination by zookeeper and introduction to kazoo python...
Jimmy Lai
 
ZooKeeper - wait free protocol for coordinating processes
Julia Proskurnia
 
Overview of Zookeeper, Helix and Kafka (Oakjug)
Chris Richardson
 
Winter is coming? Not if ZooKeeper is there!
Joydeep Banik Roy
 
Jcconf 2016 zookeeper
Matt Ho
 
Zookeeper
Geng-Dian Huang
 
Dynamic Reconfiguration of Apache ZooKeeper
DataWorks Summit
 
Ad

Similar to Handling Redis failover with ZooKeeper (20)

PDF
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
CloudxLab
 
PPTX
Zookeeper Tutorial for beginners
jeetendra mandal
 
PPTX
Zookeeper big sonata
Anh Le
 
PPTX
So we're running Apache ZooKeeper. Now What? By Camille Fournier
Hakka Labs
 
PPTX
Distributed Applications with Apache Zookeeper
Alex Ehrnschwender
 
PDF
ZooKeeper Recipes and Solutions
Jeff Smith
 
PDF
ZooKeeper Recipes and Solutions
Jeff Smith
 
PDF
ZooKeeper Recipes and Solutions
Jeff Smith
 
PDF
RedisConf18 - Redis at LINE - 25 Billion Messages Per Day
Redis Labs
 
PPTX
Zookeeper
venkata ramireddy
 
PPTX
Apache zookeeper 101
Quach Tung
 
PPTX
Redis Clustering Advanced___31Mar2025.pptx
poojanarulansit
 
PPTX
Leo's Notes about Apache Kafka
Léopold Gault
 
PDF
Tales Of The Black Knight - Keeping EverythingMe running
Dvir Volk
 
ODP
Coordination of Distributed Software with Redis
Konrad Bucheli
 
PDF
Introduction to ZooKeeper - TriHUG May 22, 2012
mumrah
 
PDF
Distributed Coordination with Python
OSCON Byrum
 
PDF
Tech Talks_25.04.15_Session 3_Tibor Sulyan_Distributed coordination with zook...
EPAM_Systems_Bulgaria
 
PDF
Redis: REmote DIctionary Server
Ezra Zygmuntowicz
 
PPTX
Introduction to apache zoo keeper
Omid Vahdaty
 
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
CloudxLab
 
Zookeeper Tutorial for beginners
jeetendra mandal
 
Zookeeper big sonata
Anh Le
 
So we're running Apache ZooKeeper. Now What? By Camille Fournier
Hakka Labs
 
Distributed Applications with Apache Zookeeper
Alex Ehrnschwender
 
ZooKeeper Recipes and Solutions
Jeff Smith
 
ZooKeeper Recipes and Solutions
Jeff Smith
 
ZooKeeper Recipes and Solutions
Jeff Smith
 
RedisConf18 - Redis at LINE - 25 Billion Messages Per Day
Redis Labs
 
Apache zookeeper 101
Quach Tung
 
Redis Clustering Advanced___31Mar2025.pptx
poojanarulansit
 
Leo's Notes about Apache Kafka
Léopold Gault
 
Tales Of The Black Knight - Keeping EverythingMe running
Dvir Volk
 
Coordination of Distributed Software with Redis
Konrad Bucheli
 
Introduction to ZooKeeper - TriHUG May 22, 2012
mumrah
 
Distributed Coordination with Python
OSCON Byrum
 
Tech Talks_25.04.15_Session 3_Tibor Sulyan_Distributed coordination with zook...
EPAM_Systems_Bulgaria
 
Redis: REmote DIctionary Server
Ezra Zygmuntowicz
 
Introduction to apache zoo keeper
Omid Vahdaty
 
Ad

Recently uploaded (20)

PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Digital Circuits, important subject in CS
contactparinay1
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 

Handling Redis failover with ZooKeeper

Editor's Notes