SlideShare a Scribd company logo
1 of 34
Multi-Master Geo Distributed Redis
With Redis Enterprise (Redise)
Elad Ash
Challenge and requirements
The solution in a nutshell
Redis data types examples
Status and availability
What we’ll cover
challenge and requirements
Use Cases - multi-master multi-region REDIS
• Geo Distributed Trading/Bidding
- Auctions, Bids/Asks
Lists/Sorted Sets tracking Bids and Asks
• Dashboards & Scoreboards
- Tracking Geo Distributed Scoreboards
Sorted Sets tracking ordered scores
• Real-time session management and
Metering Apps
- HA for session management
- Tracking Usage/Consumption
- A/B testing
Hashes/Sets/Lists/Expiry Tracking Consumption Events
• Fraud Detection
- Geo Distributed Event Tracking
Sets Gathering Geo Distributed Events
• Social Engagement Apps
- Encoding Social Engagement
Distributed Counters for “Likes”, “Shares”, “Retweets”
• Collaboration Apps
- Constructing Smart Timelines
Merged Lists Ordering Posts
- Instant Messaging & Conversation Tracking
Merged Lists Ordering Conversations
The 3 base requirements
1.Scale the same data set globally
2.Redis speed
3.No change to application
App
Scaling multi region redis challenge - Consensus?
Redis is fast: > 1,000,000 ops/sec, < 1 mSec
latency
Network east-west RTT is even slower > 70 mSec
Consensus requires clusters coordination which is
too slow for Redis
LWW by itself, can't solve Redis complex data-
type conflicts
The solution in a nutshell
Redislabs CRDB
Geo-Replicated
(Strong) Eventually Consistent
CRDTs based Redis
Conflict free Resolved DataBase | Cross Region DataBase | Cluster Replicated DataBase
Redis Replication
Been there forever...
Master -> Slave(s) model
Slave may be a master for other slaves
Constructed for High Availability (switch roles)
Redise replica-of for geo replication
DB1:
Read/Write replica
DB5:
Read replica
DB3:
Read replica
DB4:
Read replica
DB2:
Read replica
Redis Modules
● Since 4.0
● Dynamic libraries loaded to Redis
● With a C API
● Can extend Redis with:
New Capabilities
New Commands
New Data Types
10
CRDTs
Conflict Free Replicated Data Types (CRDTs)
• Years of academic research
• Based on consensus free protocol
• Strong eventual consistency
• Built to resolve conflicts with complex data
types
• Mostly transparent to users
Commutative
DAG
CmRDT
Reaching (Strong) Eventual Consistency with CRDT
1. Local ops: Reads & Writes locally
2. Async replication: Writes ops asynchronously replicated to all replicas
3. Consistency: CRDT model guarantees that the data-set would converge
to the same values, regardless of the order
Partial inconsistency - In any given time, the reads may yield different values,
but eventually (dependent on network latency) the values would converge
Simplify conflicts identifications - Maintain partial global ordering (identify
concurrent ops) = vector clocks
Vector Clocks for partial global ordering
A
B
C
{A=1,B=0,C=0}
{A=1,B=1,C=0}
{A=0}
{B=0}
{C=0}
{A=0,B=0,C=1} {A=0,B=0,C=2}
{A=1,B=2,C=0}
{A=0,B=0,C=3}
{A=1,B=3,C=3}
{A=2,B=3,C=3}
CRDB building blocks
Building block #1 - Redis Replication
Building block #2 - Redise Replica-Of for geo cluster replication
Building block #4 - Internal CRDT engine - strong eventual consistency
Building block #3 - Redis Modules
All together - CRDB: CRDT over Redise
Conflict free Resolved DataBase | Cross Region DataBase | Cluster Replicated DataBase
App
App App
CRDT
Module
CRDT
Module
CRDT
Module
1. Local read/writes
where clients use
regular redis commands
3. Bi-directional secured and
compressed async replica-of
a.k.a peer-replication
2. CRDTs implemented using
Redis Module
Demo
1. 1 geo distributed DB, replicated over 3 clusters
(replicas) on 3 regions: us-east, us-west, eu-west
2. Each Redise cluster generate load with
memtier_benchmark and a custom-built web-app.
3. To achieve Strong (without consensus protocol)
eventual consistency
● Operations are replicated between all replicas
(bi-directional and compressed)
● Use conflict free data types
<add image of the
items view>
The benefits
Support different network topology
Support different cluster topologies as
well as scaling local DB as needed
RingFully-Connected
Performance is as fast as regular local redis
and enhanced globaly by replicas count
Data types examples
Example setup
App
AppReplica A Replica B
Two replicas, working over single data sets
Each step is done concurrently and then a synchronization takes
place
Then we present the reconciled value on both replica
COUNTERS
COUNTER: Creation
App
AppReplica A Replica B
> INCRBY mykey 10
(integer) 10
> GET mykey
(nil)
Syncing
Synced
> GET mykey
“10”
> GET mykey
“10”
> GET mykey
“10”
COUNTER: Multi-Value
App
AppReplica A Replica B
> INCRBY mykey 5
(integer) 15
> INCRBY mykey 8
(integer) 18
Syncing
Synced
> GET mykey
“23”
> GET mykey
“23”
COUNTER: Add wins / Observed remove
App
AppReplica A Replica B
> DEL mykey
(integer) 1
> DECRBY mykey 3
(integer) 20
Syncing
Synced
> GET mykey
(nil)
> GET mykey
“-3”
> GET mykey
“-3”
SETs
SET: Add wins / Observed remove
App
AppReplica A Replica B
> SADD myset X
(integer) 1
Syncing
Synced
> SMEMBERS myset
1) “X”
> SMEMBERS myset
1) “X”
> SMEMBERS myset
1) “X”
> SADD myset X
(integer) 1
> SREM myset X
(integer) 1
> SMEMBERS myset
(empty list or set)
SET: Add wins / Observed remove - another example
App
AppReplica A Replica B
Syncing
Synced
> SMEMBERS myset
1) “Y”
2) “X”
> SMEMBERS myset
1) “Y”
> SMEMBERS myset
1) “Y”
> DEL myset
(integer) 0
> SMEMBERS myset
(empty list or set)
> SADD myset Y
(integer) 1
REGISTERS (STRINGS)
STRINGS: Last Write Wins
App
AppReplica A Replica B
> SET mykey “A”
OK
Syncing
Synced
> GET mykey
“A”
> GET mykey
1) “B”
> GET mykey
1) “B”
> GET mykey
“B”
> SET mykey “B”
OK
Replica B write time is later the replica A
STRING: Add wins / Observed remove
App
AppReplica A Replica B
> DEL mykey
(integer)
> SET mykey “C”
OK
Syncing
Synced
> GET mykey
(nil)
> GET mykey
“C”
> GET mykey
“C”
> GET mykey
“C”
Status and Availability
Where will it be available
Status and
Availability
Preview state
1.Strings (Registers)
2.Counters
3.Sets
4.Pub-Sub
5.Expiry
6.Hashes
Preview in the next few month
Contact pm.group@redislabs.com
To enroll
GA with next version of RePack and
Re Cloud Private and
(2017)
Questions
Thank You
Elad Ash
VP R&D
Redislabs
Mail, Twitter, Linkedin

More Related Content

What's hot

Distributed Caching in Kubernetes with Hazelcast
Distributed Caching in Kubernetes with HazelcastDistributed Caching in Kubernetes with Hazelcast
Distributed Caching in Kubernetes with HazelcastMesut Celik
 
Developing Active-Active Geo-Distributed Apps with Redis
Developing Active-Active Geo-Distributed Apps with RedisDeveloping Active-Active Geo-Distributed Apps with Redis
Developing Active-Active Geo-Distributed Apps with RedisCihan Biyikoglu
 
Enabling new protocol processing with DPDK using Dynamic Device Personalization
Enabling new protocol processing with DPDK using Dynamic Device PersonalizationEnabling new protocol processing with DPDK using Dynamic Device Personalization
Enabling new protocol processing with DPDK using Dynamic Device PersonalizationMichelle Holley
 
Lessons Learned: Troubleshooting Replication
Lessons Learned: Troubleshooting ReplicationLessons Learned: Troubleshooting Replication
Lessons Learned: Troubleshooting ReplicationSveta Smirnova
 
Kubernetes Networking with Cilium - Deep Dive
Kubernetes Networking with Cilium - Deep DiveKubernetes Networking with Cilium - Deep Dive
Kubernetes Networking with Cilium - Deep DiveMichal Rostecki
 
Better than you think: Handling JSON data in ClickHouse
Better than you think: Handling JSON data in ClickHouseBetter than you think: Handling JSON data in ClickHouse
Better than you think: Handling JSON data in ClickHouseAltinity Ltd
 
Android Tools for Qualcomm Snapdragon Processors
Android Tools for Qualcomm Snapdragon Processors Android Tools for Qualcomm Snapdragon Processors
Android Tools for Qualcomm Snapdragon Processors Qualcomm Developer Network
 
Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL AdministrationEDB
 
IntelON 2021 Processor Benchmarking
IntelON 2021 Processor BenchmarkingIntelON 2021 Processor Benchmarking
IntelON 2021 Processor BenchmarkingBrendan Gregg
 
How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?Alkin Tezuysal
 
ProxySQL for MySQL
ProxySQL for MySQLProxySQL for MySQL
ProxySQL for MySQLMydbops
 
Cilium - BPF & XDP for containers
 Cilium - BPF & XDP for containers Cilium - BPF & XDP for containers
Cilium - BPF & XDP for containersDocker, Inc.
 
redis 소개자료 - 네오클로바
redis 소개자료 - 네오클로바redis 소개자료 - 네오클로바
redis 소개자료 - 네오클로바NeoClova
 
Using ClickHouse for Experimentation
Using ClickHouse for ExperimentationUsing ClickHouse for Experimentation
Using ClickHouse for ExperimentationGleb Kanterov
 
NGINX: Basics and Best Practices
NGINX: Basics and Best PracticesNGINX: Basics and Best Practices
NGINX: Basics and Best PracticesNGINX, Inc.
 
Kernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uringKernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uringAnne Nicolas
 
PostgreSQL HA
PostgreSQL   HAPostgreSQL   HA
PostgreSQL HAharoonm
 
Group Replication in MySQL 8.0 ( A Walk Through )
Group Replication in MySQL 8.0 ( A Walk Through ) Group Replication in MySQL 8.0 ( A Walk Through )
Group Replication in MySQL 8.0 ( A Walk Through ) Mydbops
 
A Fast Intro to Fast Query with ClickHouse, by Robert Hodges
A Fast Intro to Fast Query with ClickHouse, by Robert HodgesA Fast Intro to Fast Query with ClickHouse, by Robert Hodges
A Fast Intro to Fast Query with ClickHouse, by Robert HodgesAltinity Ltd
 

What's hot (20)

Asterisk: the future is at REST
Asterisk: the future is at RESTAsterisk: the future is at REST
Asterisk: the future is at REST
 
Distributed Caching in Kubernetes with Hazelcast
Distributed Caching in Kubernetes with HazelcastDistributed Caching in Kubernetes with Hazelcast
Distributed Caching in Kubernetes with Hazelcast
 
Developing Active-Active Geo-Distributed Apps with Redis
Developing Active-Active Geo-Distributed Apps with RedisDeveloping Active-Active Geo-Distributed Apps with Redis
Developing Active-Active Geo-Distributed Apps with Redis
 
Enabling new protocol processing with DPDK using Dynamic Device Personalization
Enabling new protocol processing with DPDK using Dynamic Device PersonalizationEnabling new protocol processing with DPDK using Dynamic Device Personalization
Enabling new protocol processing with DPDK using Dynamic Device Personalization
 
Lessons Learned: Troubleshooting Replication
Lessons Learned: Troubleshooting ReplicationLessons Learned: Troubleshooting Replication
Lessons Learned: Troubleshooting Replication
 
Kubernetes Networking with Cilium - Deep Dive
Kubernetes Networking with Cilium - Deep DiveKubernetes Networking with Cilium - Deep Dive
Kubernetes Networking with Cilium - Deep Dive
 
Better than you think: Handling JSON data in ClickHouse
Better than you think: Handling JSON data in ClickHouseBetter than you think: Handling JSON data in ClickHouse
Better than you think: Handling JSON data in ClickHouse
 
Android Tools for Qualcomm Snapdragon Processors
Android Tools for Qualcomm Snapdragon Processors Android Tools for Qualcomm Snapdragon Processors
Android Tools for Qualcomm Snapdragon Processors
 
Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL Administration
 
IntelON 2021 Processor Benchmarking
IntelON 2021 Processor BenchmarkingIntelON 2021 Processor Benchmarking
IntelON 2021 Processor Benchmarking
 
How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?
 
ProxySQL for MySQL
ProxySQL for MySQLProxySQL for MySQL
ProxySQL for MySQL
 
Cilium - BPF & XDP for containers
 Cilium - BPF & XDP for containers Cilium - BPF & XDP for containers
Cilium - BPF & XDP for containers
 
redis 소개자료 - 네오클로바
redis 소개자료 - 네오클로바redis 소개자료 - 네오클로바
redis 소개자료 - 네오클로바
 
Using ClickHouse for Experimentation
Using ClickHouse for ExperimentationUsing ClickHouse for Experimentation
Using ClickHouse for Experimentation
 
NGINX: Basics and Best Practices
NGINX: Basics and Best PracticesNGINX: Basics and Best Practices
NGINX: Basics and Best Practices
 
Kernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uringKernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uring
 
PostgreSQL HA
PostgreSQL   HAPostgreSQL   HA
PostgreSQL HA
 
Group Replication in MySQL 8.0 ( A Walk Through )
Group Replication in MySQL 8.0 ( A Walk Through ) Group Replication in MySQL 8.0 ( A Walk Through )
Group Replication in MySQL 8.0 ( A Walk Through )
 
A Fast Intro to Fast Query with ClickHouse, by Robert Hodges
A Fast Intro to Fast Query with ClickHouse, by Robert HodgesA Fast Intro to Fast Query with ClickHouse, by Robert Hodges
A Fast Intro to Fast Query with ClickHouse, by Robert Hodges
 

Similar to CRDB - Multi-Master Geo Distributed Redis with Redis Enterprise

Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBRaghunath A
 
AWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDB
AWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDBAWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDB
AWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDBAmazon Web Services
 
Achieve big data analytic platform with lambda architecture on cloud
Achieve big data analytic platform with lambda architecture on cloudAchieve big data analytic platform with lambda architecture on cloud
Achieve big data analytic platform with lambda architecture on cloudScott Miao
 
Download It
Download ItDownload It
Download Itbutest
 
Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...
Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...
Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...DataStax Academy
 
Distributed computing poli
Distributed computing poliDistributed computing poli
Distributed computing poliivascucristian
 
AWS Summit Seoul 2015 - AWS 최신 서비스 살펴보기 - Aurora, Lambda, EFS, Machine Learn...
AWS Summit Seoul 2015 -  AWS 최신 서비스 살펴보기 - Aurora, Lambda, EFS, Machine Learn...AWS Summit Seoul 2015 -  AWS 최신 서비스 살펴보기 - Aurora, Lambda, EFS, Machine Learn...
AWS Summit Seoul 2015 - AWS 최신 서비스 살펴보기 - Aurora, Lambda, EFS, Machine Learn...Amazon Web Services Korea
 
Plandas-CacheCloud
Plandas-CacheCloudPlandas-CacheCloud
Plandas-CacheCloudGyuman Cho
 
Apache Hadoop India Summit 2011 talk "Making Hadoop Enterprise Ready with Am...
Apache Hadoop India Summit 2011 talk  "Making Hadoop Enterprise Ready with Am...Apache Hadoop India Summit 2011 talk  "Making Hadoop Enterprise Ready with Am...
Apache Hadoop India Summit 2011 talk "Making Hadoop Enterprise Ready with Am...Yahoo Developer Network
 
Software architecture for data applications
Software architecture for data applicationsSoftware architecture for data applications
Software architecture for data applicationsDing Li
 
Azure Cosmos DB - Technical Deep Dive
Azure Cosmos DB - Technical Deep DiveAzure Cosmos DB - Technical Deep Dive
Azure Cosmos DB - Technical Deep DiveAndre Essing
 
Design Patterns Facilitated by Geode's WAN Distribution
Design Patterns Facilitated by Geode's WAN DistributionDesign Patterns Facilitated by Geode's WAN Distribution
Design Patterns Facilitated by Geode's WAN DistributionVMware Tanzu
 
Stratosphere with big_data_analytics
Stratosphere with big_data_analyticsStratosphere with big_data_analytics
Stratosphere with big_data_analyticsAvinash Pandu
 
Rishikesh Sharma Portfolio
Rishikesh Sharma PortfolioRishikesh Sharma Portfolio
Rishikesh Sharma Portfoliosharmarishikesh
 
Embarrassingly/Delightfully Parallel Problems
Embarrassingly/Delightfully Parallel ProblemsEmbarrassingly/Delightfully Parallel Problems
Embarrassingly/Delightfully Parallel ProblemsDilum Bandara
 
How to Monitor Application Performance in a Container-Based World
How to Monitor Application Performance in a Container-Based WorldHow to Monitor Application Performance in a Container-Based World
How to Monitor Application Performance in a Container-Based WorldKen Owens
 
Monitoring as Software Validation
Monitoring as Software ValidationMonitoring as Software Validation
Monitoring as Software ValidationBioDec
 

Similar to CRDB - Multi-Master Geo Distributed Redis with Redis Enterprise (20)

Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
AWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDB
AWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDBAWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDB
AWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDB
 
Achieve big data analytic platform with lambda architecture on cloud
Achieve big data analytic platform with lambda architecture on cloudAchieve big data analytic platform with lambda architecture on cloud
Achieve big data analytic platform with lambda architecture on cloud
 
Download It
Download ItDownload It
Download It
 
Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...
Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...
Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...
 
Bigdata meetup dwarak_realtime_score_app
Bigdata meetup dwarak_realtime_score_appBigdata meetup dwarak_realtime_score_app
Bigdata meetup dwarak_realtime_score_app
 
Distributed computing poli
Distributed computing poliDistributed computing poli
Distributed computing poli
 
AWS Summit Seoul 2015 - AWS 최신 서비스 살펴보기 - Aurora, Lambda, EFS, Machine Learn...
AWS Summit Seoul 2015 -  AWS 최신 서비스 살펴보기 - Aurora, Lambda, EFS, Machine Learn...AWS Summit Seoul 2015 -  AWS 최신 서비스 살펴보기 - Aurora, Lambda, EFS, Machine Learn...
AWS Summit Seoul 2015 - AWS 최신 서비스 살펴보기 - Aurora, Lambda, EFS, Machine Learn...
 
Plandas-CacheCloud
Plandas-CacheCloudPlandas-CacheCloud
Plandas-CacheCloud
 
Presentation
PresentationPresentation
Presentation
 
NoSQL and ACID
NoSQL and ACIDNoSQL and ACID
NoSQL and ACID
 
Apache Hadoop India Summit 2011 talk "Making Hadoop Enterprise Ready with Am...
Apache Hadoop India Summit 2011 talk  "Making Hadoop Enterprise Ready with Am...Apache Hadoop India Summit 2011 talk  "Making Hadoop Enterprise Ready with Am...
Apache Hadoop India Summit 2011 talk "Making Hadoop Enterprise Ready with Am...
 
Software architecture for data applications
Software architecture for data applicationsSoftware architecture for data applications
Software architecture for data applications
 
Azure Cosmos DB - Technical Deep Dive
Azure Cosmos DB - Technical Deep DiveAzure Cosmos DB - Technical Deep Dive
Azure Cosmos DB - Technical Deep Dive
 
Design Patterns Facilitated by Geode's WAN Distribution
Design Patterns Facilitated by Geode's WAN DistributionDesign Patterns Facilitated by Geode's WAN Distribution
Design Patterns Facilitated by Geode's WAN Distribution
 
Stratosphere with big_data_analytics
Stratosphere with big_data_analyticsStratosphere with big_data_analytics
Stratosphere with big_data_analytics
 
Rishikesh Sharma Portfolio
Rishikesh Sharma PortfolioRishikesh Sharma Portfolio
Rishikesh Sharma Portfolio
 
Embarrassingly/Delightfully Parallel Problems
Embarrassingly/Delightfully Parallel ProblemsEmbarrassingly/Delightfully Parallel Problems
Embarrassingly/Delightfully Parallel Problems
 
How to Monitor Application Performance in a Container-Based World
How to Monitor Application Performance in a Container-Based WorldHow to Monitor Application Performance in a Container-Based World
How to Monitor Application Performance in a Container-Based World
 
Monitoring as Software Validation
Monitoring as Software ValidationMonitoring as Software Validation
Monitoring as Software Validation
 

Recently uploaded

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 

Recently uploaded (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

CRDB - Multi-Master Geo Distributed Redis with Redis Enterprise

  • 1. Multi-Master Geo Distributed Redis With Redis Enterprise (Redise) Elad Ash
  • 2. Challenge and requirements The solution in a nutshell Redis data types examples Status and availability What we’ll cover
  • 4. Use Cases - multi-master multi-region REDIS • Geo Distributed Trading/Bidding - Auctions, Bids/Asks Lists/Sorted Sets tracking Bids and Asks • Dashboards & Scoreboards - Tracking Geo Distributed Scoreboards Sorted Sets tracking ordered scores • Real-time session management and Metering Apps - HA for session management - Tracking Usage/Consumption - A/B testing Hashes/Sets/Lists/Expiry Tracking Consumption Events • Fraud Detection - Geo Distributed Event Tracking Sets Gathering Geo Distributed Events • Social Engagement Apps - Encoding Social Engagement Distributed Counters for “Likes”, “Shares”, “Retweets” • Collaboration Apps - Constructing Smart Timelines Merged Lists Ordering Posts - Instant Messaging & Conversation Tracking Merged Lists Ordering Conversations
  • 5. The 3 base requirements 1.Scale the same data set globally 2.Redis speed 3.No change to application
  • 6. App Scaling multi region redis challenge - Consensus? Redis is fast: > 1,000,000 ops/sec, < 1 mSec latency Network east-west RTT is even slower > 70 mSec Consensus requires clusters coordination which is too slow for Redis LWW by itself, can't solve Redis complex data- type conflicts
  • 7. The solution in a nutshell Redislabs CRDB Geo-Replicated (Strong) Eventually Consistent CRDTs based Redis Conflict free Resolved DataBase | Cross Region DataBase | Cluster Replicated DataBase
  • 8. Redis Replication Been there forever... Master -> Slave(s) model Slave may be a master for other slaves Constructed for High Availability (switch roles)
  • 9. Redise replica-of for geo replication DB1: Read/Write replica DB5: Read replica DB3: Read replica DB4: Read replica DB2: Read replica
  • 10. Redis Modules ● Since 4.0 ● Dynamic libraries loaded to Redis ● With a C API ● Can extend Redis with: New Capabilities New Commands New Data Types 10
  • 11. CRDTs Conflict Free Replicated Data Types (CRDTs) • Years of academic research • Based on consensus free protocol • Strong eventual consistency • Built to resolve conflicts with complex data types • Mostly transparent to users Commutative DAG CmRDT
  • 12. Reaching (Strong) Eventual Consistency with CRDT 1. Local ops: Reads & Writes locally 2. Async replication: Writes ops asynchronously replicated to all replicas 3. Consistency: CRDT model guarantees that the data-set would converge to the same values, regardless of the order Partial inconsistency - In any given time, the reads may yield different values, but eventually (dependent on network latency) the values would converge Simplify conflicts identifications - Maintain partial global ordering (identify concurrent ops) = vector clocks
  • 13. Vector Clocks for partial global ordering A B C {A=1,B=0,C=0} {A=1,B=1,C=0} {A=0} {B=0} {C=0} {A=0,B=0,C=1} {A=0,B=0,C=2} {A=1,B=2,C=0} {A=0,B=0,C=3} {A=1,B=3,C=3} {A=2,B=3,C=3}
  • 14. CRDB building blocks Building block #1 - Redis Replication Building block #2 - Redise Replica-Of for geo cluster replication Building block #4 - Internal CRDT engine - strong eventual consistency Building block #3 - Redis Modules
  • 15. All together - CRDB: CRDT over Redise Conflict free Resolved DataBase | Cross Region DataBase | Cluster Replicated DataBase App App App CRDT Module CRDT Module CRDT Module 1. Local read/writes where clients use regular redis commands 3. Bi-directional secured and compressed async replica-of a.k.a peer-replication 2. CRDTs implemented using Redis Module
  • 16. Demo 1. 1 geo distributed DB, replicated over 3 clusters (replicas) on 3 regions: us-east, us-west, eu-west 2. Each Redise cluster generate load with memtier_benchmark and a custom-built web-app. 3. To achieve Strong (without consensus protocol) eventual consistency ● Operations are replicated between all replicas (bi-directional and compressed) ● Use conflict free data types <add image of the items view>
  • 17. The benefits Support different network topology Support different cluster topologies as well as scaling local DB as needed RingFully-Connected Performance is as fast as regular local redis and enhanced globaly by replicas count
  • 19. Example setup App AppReplica A Replica B Two replicas, working over single data sets Each step is done concurrently and then a synchronization takes place Then we present the reconciled value on both replica
  • 21. COUNTER: Creation App AppReplica A Replica B > INCRBY mykey 10 (integer) 10 > GET mykey (nil) Syncing Synced > GET mykey “10” > GET mykey “10” > GET mykey “10”
  • 22. COUNTER: Multi-Value App AppReplica A Replica B > INCRBY mykey 5 (integer) 15 > INCRBY mykey 8 (integer) 18 Syncing Synced > GET mykey “23” > GET mykey “23”
  • 23. COUNTER: Add wins / Observed remove App AppReplica A Replica B > DEL mykey (integer) 1 > DECRBY mykey 3 (integer) 20 Syncing Synced > GET mykey (nil) > GET mykey “-3” > GET mykey “-3”
  • 24. SETs
  • 25. SET: Add wins / Observed remove App AppReplica A Replica B > SADD myset X (integer) 1 Syncing Synced > SMEMBERS myset 1) “X” > SMEMBERS myset 1) “X” > SMEMBERS myset 1) “X” > SADD myset X (integer) 1 > SREM myset X (integer) 1 > SMEMBERS myset (empty list or set)
  • 26. SET: Add wins / Observed remove - another example App AppReplica A Replica B Syncing Synced > SMEMBERS myset 1) “Y” 2) “X” > SMEMBERS myset 1) “Y” > SMEMBERS myset 1) “Y” > DEL myset (integer) 0 > SMEMBERS myset (empty list or set) > SADD myset Y (integer) 1
  • 28. STRINGS: Last Write Wins App AppReplica A Replica B > SET mykey “A” OK Syncing Synced > GET mykey “A” > GET mykey 1) “B” > GET mykey 1) “B” > GET mykey “B” > SET mykey “B” OK Replica B write time is later the replica A
  • 29. STRING: Add wins / Observed remove App AppReplica A Replica B > DEL mykey (integer) > SET mykey “C” OK Syncing Synced > GET mykey (nil) > GET mykey “C” > GET mykey “C” > GET mykey “C”
  • 31. Where will it be available
  • 32. Status and Availability Preview state 1.Strings (Registers) 2.Counters 3.Sets 4.Pub-Sub 5.Expiry 6.Hashes Preview in the next few month Contact pm.group@redislabs.com To enroll GA with next version of RePack and Re Cloud Private and (2017)
  • 34. Thank You Elad Ash VP R&D Redislabs Mail, Twitter, Linkedin

Editor's Notes

  1. I’m Elad and I’m the VP of R&D for redislabs over the last couple of years. What I’ll attempt in the following 45 min is to give you an overview on the concept of multi-master geo distributed redis solution we have. Redis is fast, we all know that, but when you add traffic over network, we all know that we add the network latency. Our customers are not looking just to scale a DB over Geo Regons, they want it to be Redis Fast. In the session today, I’ll speak about the ability to scale redis over multiple geographical regions in multi-master manner: meaning enjoying local latency and performance while scaling data-set globaly.
  2. Anyof you need redis to scale across geo regions
  3. Not just scaling a DB over Geo Regions. Keep speed when scaling
  4. needs to scale globally. Avoid latency ⇒ distribute DB on multiple regions Converge data (conflict resolutions and consistency)
  5. It is important to emphasis that the work is done on the same keys. Though the types might change, it shouldn’t effect the client side
  6. Redis is fast, but we need to keep it as fast when scaling it geographically
  7. The basic of the solution is a bi-derctional compressed replication of
  8. I assume all are familiar with this. Replication is LOCAL. Elaborat that the HA is so that the master and slaves can switch roles between them on a situation of failover As for replication can be read write, if I mention it, we need to explain the problems with full sync where we’ll either loose consistency with master or loose what the master written
  9. This is already global Replica-Of feature. Encapsulated databases. Wan Optimization. Can support different cluster topologies
  10. This is used for running CRDTs, which also shows the strength of the modules as a solution. No change on the users application
  11. By show of hands, how many are familiar with CRDT concept? Semilattice idempotent (f(f(x)) = f(x) Commutative axb = bxa associative (ax(bxc) = (axb)xc), Explain what we mean by mostly, For example If you use list as a stack, you can’t promise that you concurrently in the same replica, the same element can’t pop more then once, to implement it we need a kind of cross region semaphores. Expiry (the concept of expiry win)
  12. Eventual Consistency => Local reads and writes, NO SYNC. Redis Replication is similar Different copies of dataset - CONVERGE EVENTUALLY.
  13. Track CAUSE and EFFECT Casual = meaning that there is some order, one operation was done after or before another. Effect with vector clocks, enables this causality, it means that all entries of of one replica is >= another replica, and at least one is different. If not, we can know that the operations are concurrent. When we identify concurrent operation we handle them differently to achieve consistency: Registers = LWW | Add wins | Expiry wins |
  14. Explain that the replication is based on proven replica-of mechanism which is used in Redis enterprise for a long time. Speak about the demo structure a bit. Add direct contact to the redis itself and send some commands to the DB and show them on the other one such as: Sets - Strings - Counters - PubSub -
  15. I won’t get into the details of how we acheive the actual implementation, I will keep it from a user’s point of view.
  16. Note that types changes are not supported at the moment, so a counter needs to be set only with incrby, in the future we’ll enable some modifications for that
  17. Took both of the incrementations into account Multi value as the counter is saved with entry per replica.
  18. The deletion will be done for the values it was aware of only.
  19. The add wins concept won and created that at the end the X value added on replica A will win
  20. The deletes worked only on what was viewed by on the time of delete, so X was removed, while Y wasn’t as it was not observed on the time of the removal
  21. Since the writes were done concurrently, the last write time wins and the value is “B”
  22. The key is set to C though the delete took place the change wasn’t oserved by the deleting replica and it wasn’t deleted.
  23. State that whoever would like to get a preview version, can contact our VP Product - Cihan