SlideShare a Scribd company logo
1 of 20
Download to read offline
Bilateral Anti-Entropy:
Achieving Cost-Effective Eventual Consistency
by Dr. Rebecca Bilbro
Rotational Labs, LLC
alpha
bravo
charlie
delta
echo
Imagine a network of
connected servers – a
distributed system.
They also make it more available,
that is, responsive even to many
simultaneous client requests. Each peer has a copy of the
database and can respond
independently.
The servers are peers.
Working together, they can
make the system more
tolerant to failures like
earthquakes and outages.
This means that the peers have to figure out how
to synchronize independent updates to the data…
set key X to value Y set key P to value Q
alpha bravo
… and sometimes they’ll have to resolve conflicts!
set key M to value N set key M to value F
alpha bravo
alpha bravo
The peers can’t see into each other’s copies of the database, so they have
to communicate via remote procedure calls (RPCs) to share information.
The communication has to be extremely efficient so the system doesn’t
slow down too much while synchronization is happening.
Note: This is a good use case for protocol buffers!
The tradeoffs include things like:
- staleness (how bad will it be if users sometimes see old data
before it’s updated?)
- expense (how many messages have to travel across the wire;
how many clusters are we hosting?)
strong causal eventual
More consistency, higher latency, lower availability
There are a number of ways to implement synchronization and
achieve consensus, depending on how consistent the system
needs to be.
Eventual consistency is a good budget-friendly choice for
applications that choose to prioritize higher availability and lower
latency over consistency.
alpha
bravo
M:N
M:F
time
alpha
bravo
M:N
M:N
Given enough time to catch up on synchronizations, the system will
eventually be fully consistent, meaning that every peer will
eventually contain the same data objects.
Anti-entropy (aka “gossip”) is a mechanism for achieving eventual
consistency. It enables peers to periodically share their perspective of
the data with another peer in the system.
alpha bravo
P:Q
M:N
D:F
L:S
P:Q v3
M:N v11
D:F v5
L:S v1
Alpha shares its
current values for each
object with bravo as
well as each object’s
version vector.
Each time a peer gets a
client request to update a
value, it also increments
the object’s version vector.
Version vectors encode
provenance and change
history information.
The version vector will
allow bravo to compare
the values it has for
each object, and to
decide whether or not
to update them.
bravo
P:Q v3
M:N v11
D:F v5
L:S v1
P:Q v3
M:Z v10
D:F v5
If bravo has a smaller version number
for an object compared to alpha, it
knows it should update its local value.
what alpha has what I have If bravo sees
alpha has an
object it
doesn’t
already know
about, it can
add it locally.
What if alpha and bravo
have different values for
the same key, but the
same version vector? In
this case, bravo needs a
tie-breaker.
bravo
D:F v5 D:B v5
what alpha has what I have
Bravo will compare its global process id (PID)
to alpha’s. If alpha’s PID is lower, bravo will
update its local value for the object. PIDs are
unique, so each peer is guaranteed to have a
different number.
alpha
PID 1
PID 2
With bilateral anti-entropy, we can
enable alpha not only to share its
data and version vectors with
bravo, but also receive data and
version vectors back from bravo.
If alpha is initiating anti-entropy,
it will begin by sharing its version
vectors for all objects with bravo.
This is known as the “push” phase.
After it notifies bravo that the
push phase is complete, alpha will
receive data and version vectors
from bravo, which is the “pull”
phase.
alpha bravo
PID 2
PID 1
push
pull
As the receiver, bravo also experiences
anti-entropy in multiple phases.
First, bravo starts receiving version vectors
for each of alpha’s objects.
alpha bravo
PID 2
PID 1
get version vectors
Bravo then uses the version vectors to
determine which objects to ask alpha for.
alpha bravo
PID 2
PID 1
request data
Once bravo gets back this data from
alpha, it can use it to make local repairs.
alpha bravo
PID 2
PID 1
get data
As soon as bravo is notified that alpha’s
push phase is complete, it determines which
objects it has locally that alpha doesn’t yet
know about, and sends those back to
alpha.
alpha bravo
PID 2
PID 1
send repairs
COMPLETE
Frequently Asked
Questions
alpha
bravo
Why doesn’t alpha just send all the
data for each object it has during
the push phase? That would save
me from having to ask for it later.
Sending only version vectors is a lot
cheaper! It reduces the size of
messages across the wire.
alpha
bravo
So why is it called
a version “vector”
then?
In order to make the right changes (and make them in the right order), we
need to communicate the count of updates an object has had as well as
our PIDs (which express each of our perspectives in the system).
alpha
bravo
charlie
delta
echo
How do we know which peers
to perform anti-entropy with?
At least one peer needs to know
about some other peers in the
network to get anti-entropy
started. That peer will select a
peer at random to start
“gossiping” with.
As part of the anti-entropy
process, peers can also tell
each other about newly joined
peers in the network (and
their PIDs).
PID 1
PID 2
PID 21
PID 42
PID 88
delta
echo
How often
should we
gossip?
That’s configurable.
More gossip means
more consistency at
the price of more
messages traveling
across the network.
charlie
We could each have different anti-entropy
intervals. We also have a configured “jitter” to
prevent our anti-entropy sessions from all
happening at the exact same time.
Thank you!

More Related Content

Similar to Anti-Entropy Replication for Cost-Effective Eventual Consistency

AR Wave: A Proof of Concept - Federation, Game Dynamics, Semantic Search, Mob...
AR Wave: A Proof of Concept - Federation, Game Dynamics, Semantic Search, Mob...AR Wave: A Proof of Concept - Federation, Game Dynamics, Semantic Search, Mob...
AR Wave: A Proof of Concept - Federation, Game Dynamics, Semantic Search, Mob...Tish Shute
 
Streaming the platform with Confluent (Apache Kafka)
Streaming the platform with Confluent (Apache Kafka)Streaming the platform with Confluent (Apache Kafka)
Streaming the platform with Confluent (Apache Kafka)GiuseppeBaccini
 
kafka_session_updated.pptx
kafka_session_updated.pptxkafka_session_updated.pptx
kafka_session_updated.pptxKoiuyt1
 
Building Scalable Data Pipelines - 2016 DataPalooza Seattle
Building Scalable Data Pipelines - 2016 DataPalooza SeattleBuilding Scalable Data Pipelines - 2016 DataPalooza Seattle
Building Scalable Data Pipelines - 2016 DataPalooza SeattleEvan Chan
 
Apache Kafka vs. Integration Middleware (MQ, ETL, ESB)
Apache Kafka vs. Integration Middleware (MQ, ETL, ESB)Apache Kafka vs. Integration Middleware (MQ, ETL, ESB)
Apache Kafka vs. Integration Middleware (MQ, ETL, ESB)Kai Wähner
 
Microservices Integration Patterns with Kafka
Microservices Integration Patterns with KafkaMicroservices Integration Patterns with Kafka
Microservices Integration Patterns with KafkaKasun Indrasiri
 
Leo's Notes about Apache Kafka
Leo's Notes about Apache KafkaLeo's Notes about Apache Kafka
Leo's Notes about Apache KafkaLéopold Gault
 
Design the implementation of NMEA Get GPS Data from Record
Design the implementation of NMEA Get GPS Data from RecordDesign the implementation of NMEA Get GPS Data from Record
Design the implementation of NMEA Get GPS Data from RecordAnkita Tiwari
 
Wikipedia’s Event Data Platform, Or: JSON Is Okay Too With Andrew Otto | Curr...
Wikipedia’s Event Data Platform, Or: JSON Is Okay Too With Andrew Otto | Curr...Wikipedia’s Event Data Platform, Or: JSON Is Okay Too With Andrew Otto | Curr...
Wikipedia’s Event Data Platform, Or: JSON Is Okay Too With Andrew Otto | Curr...HostedbyConfluent
 
[Big Data Spain] Apache Spark Streaming + Kafka 0.10: an Integration Story
[Big Data Spain] Apache Spark Streaming + Kafka 0.10:  an Integration Story[Big Data Spain] Apache Spark Streaming + Kafka 0.10:  an Integration Story
[Big Data Spain] Apache Spark Streaming + Kafka 0.10: an Integration StoryJoan Viladrosa Riera
 
Cassandra Architecture
Cassandra ArchitectureCassandra Architecture
Cassandra ArchitecturePrasad Wali
 
Apache Flink Berlin Meetup May 2016
Apache Flink Berlin Meetup May 2016Apache Flink Berlin Meetup May 2016
Apache Flink Berlin Meetup May 2016Stephan Ewen
 
Flink Forward San Francisco 2018 keynote: Srikanth Satya - "Stream Processin...
Flink Forward San Francisco 2018 keynote:  Srikanth Satya - "Stream Processin...Flink Forward San Francisco 2018 keynote:  Srikanth Satya - "Stream Processin...
Flink Forward San Francisco 2018 keynote: Srikanth Satya - "Stream Processin...Flink Forward
 
Kafka Streams for Java enthusiasts
Kafka Streams for Java enthusiastsKafka Streams for Java enthusiasts
Kafka Streams for Java enthusiastsSlim Baltagi
 
Project 4 (P4) Distance Vector Routing (DV)Instructor Dr.docx
Project 4 (P4) Distance Vector Routing (DV)Instructor Dr.docxProject 4 (P4) Distance Vector Routing (DV)Instructor Dr.docx
Project 4 (P4) Distance Vector Routing (DV)Instructor Dr.docxwkyra78
 
OSMC 2016 | Softwareentwicklung aus Sicht eines #yoloWdevop by Jan Wagner
OSMC 2016 | Softwareentwicklung aus Sicht eines #yoloWdevop by Jan WagnerOSMC 2016 | Softwareentwicklung aus Sicht eines #yoloWdevop by Jan Wagner
OSMC 2016 | Softwareentwicklung aus Sicht eines #yoloWdevop by Jan WagnerNETWAYS
 
OSMC 2016: Software Development seen from a #yolo^wdevop by Jan Wagner
OSMC 2016: Software Development seen from a #yolo^wdevop by Jan WagnerOSMC 2016: Software Development seen from a #yolo^wdevop by Jan Wagner
OSMC 2016: Software Development seen from a #yolo^wdevop by Jan WagnerNETWAYS
 
Cluster_Performance_Apache_Kafak_vs_RabbitMQ
Cluster_Performance_Apache_Kafak_vs_RabbitMQCluster_Performance_Apache_Kafak_vs_RabbitMQ
Cluster_Performance_Apache_Kafak_vs_RabbitMQShameera Rathnayaka
 
Hovitaga Mass Comparison Tool - overview
Hovitaga Mass Comparison Tool - overviewHovitaga Mass Comparison Tool - overview
Hovitaga Mass Comparison Tool - overviewHovitaga Kft.
 

Similar to Anti-Entropy Replication for Cost-Effective Eventual Consistency (20)

AR Wave: A Proof of Concept - Federation, Game Dynamics, Semantic Search, Mob...
AR Wave: A Proof of Concept - Federation, Game Dynamics, Semantic Search, Mob...AR Wave: A Proof of Concept - Federation, Game Dynamics, Semantic Search, Mob...
AR Wave: A Proof of Concept - Federation, Game Dynamics, Semantic Search, Mob...
 
Streaming the platform with Confluent (Apache Kafka)
Streaming the platform with Confluent (Apache Kafka)Streaming the platform with Confluent (Apache Kafka)
Streaming the platform with Confluent (Apache Kafka)
 
kafka_session_updated.pptx
kafka_session_updated.pptxkafka_session_updated.pptx
kafka_session_updated.pptx
 
Building Scalable Data Pipelines - 2016 DataPalooza Seattle
Building Scalable Data Pipelines - 2016 DataPalooza SeattleBuilding Scalable Data Pipelines - 2016 DataPalooza Seattle
Building Scalable Data Pipelines - 2016 DataPalooza Seattle
 
Apache Kafka vs. Integration Middleware (MQ, ETL, ESB)
Apache Kafka vs. Integration Middleware (MQ, ETL, ESB)Apache Kafka vs. Integration Middleware (MQ, ETL, ESB)
Apache Kafka vs. Integration Middleware (MQ, ETL, ESB)
 
Microservices Integration Patterns with Kafka
Microservices Integration Patterns with KafkaMicroservices Integration Patterns with Kafka
Microservices Integration Patterns with Kafka
 
Leo's Notes about Apache Kafka
Leo's Notes about Apache KafkaLeo's Notes about Apache Kafka
Leo's Notes about Apache Kafka
 
Design the implementation of NMEA Get GPS Data from Record
Design the implementation of NMEA Get GPS Data from RecordDesign the implementation of NMEA Get GPS Data from Record
Design the implementation of NMEA Get GPS Data from Record
 
Wikipedia’s Event Data Platform, Or: JSON Is Okay Too With Andrew Otto | Curr...
Wikipedia’s Event Data Platform, Or: JSON Is Okay Too With Andrew Otto | Curr...Wikipedia’s Event Data Platform, Or: JSON Is Okay Too With Andrew Otto | Curr...
Wikipedia’s Event Data Platform, Or: JSON Is Okay Too With Andrew Otto | Curr...
 
[Big Data Spain] Apache Spark Streaming + Kafka 0.10: an Integration Story
[Big Data Spain] Apache Spark Streaming + Kafka 0.10:  an Integration Story[Big Data Spain] Apache Spark Streaming + Kafka 0.10:  an Integration Story
[Big Data Spain] Apache Spark Streaming + Kafka 0.10: an Integration Story
 
Kafka for Scale
Kafka for ScaleKafka for Scale
Kafka for Scale
 
Cassandra Architecture
Cassandra ArchitectureCassandra Architecture
Cassandra Architecture
 
Apache Flink Berlin Meetup May 2016
Apache Flink Berlin Meetup May 2016Apache Flink Berlin Meetup May 2016
Apache Flink Berlin Meetup May 2016
 
Flink Forward San Francisco 2018 keynote: Srikanth Satya - "Stream Processin...
Flink Forward San Francisco 2018 keynote:  Srikanth Satya - "Stream Processin...Flink Forward San Francisco 2018 keynote:  Srikanth Satya - "Stream Processin...
Flink Forward San Francisco 2018 keynote: Srikanth Satya - "Stream Processin...
 
Kafka Streams for Java enthusiasts
Kafka Streams for Java enthusiastsKafka Streams for Java enthusiasts
Kafka Streams for Java enthusiasts
 
Project 4 (P4) Distance Vector Routing (DV)Instructor Dr.docx
Project 4 (P4) Distance Vector Routing (DV)Instructor Dr.docxProject 4 (P4) Distance Vector Routing (DV)Instructor Dr.docx
Project 4 (P4) Distance Vector Routing (DV)Instructor Dr.docx
 
OSMC 2016 | Softwareentwicklung aus Sicht eines #yoloWdevop by Jan Wagner
OSMC 2016 | Softwareentwicklung aus Sicht eines #yoloWdevop by Jan WagnerOSMC 2016 | Softwareentwicklung aus Sicht eines #yoloWdevop by Jan Wagner
OSMC 2016 | Softwareentwicklung aus Sicht eines #yoloWdevop by Jan Wagner
 
OSMC 2016: Software Development seen from a #yolo^wdevop by Jan Wagner
OSMC 2016: Software Development seen from a #yolo^wdevop by Jan WagnerOSMC 2016: Software Development seen from a #yolo^wdevop by Jan Wagner
OSMC 2016: Software Development seen from a #yolo^wdevop by Jan Wagner
 
Cluster_Performance_Apache_Kafak_vs_RabbitMQ
Cluster_Performance_Apache_Kafak_vs_RabbitMQCluster_Performance_Apache_Kafak_vs_RabbitMQ
Cluster_Performance_Apache_Kafak_vs_RabbitMQ
 
Hovitaga Mass Comparison Tool - overview
Hovitaga Mass Comparison Tool - overviewHovitaga Mass Comparison Tool - overview
Hovitaga Mass Comparison Tool - overview
 

More from Rebecca Bilbro

Data Structures for Data Privacy: Lessons Learned in Production
Data Structures for Data Privacy: Lessons Learned in ProductionData Structures for Data Privacy: Lessons Learned in Production
Data Structures for Data Privacy: Lessons Learned in ProductionRebecca Bilbro
 
Conflict-Free Replicated Data Types (PyCon 2022)
Conflict-Free Replicated Data Types (PyCon 2022)Conflict-Free Replicated Data Types (PyCon 2022)
Conflict-Free Replicated Data Types (PyCon 2022)Rebecca Bilbro
 
(Py)testing the Limits of Machine Learning
(Py)testing the Limits of Machine Learning(Py)testing the Limits of Machine Learning
(Py)testing the Limits of Machine LearningRebecca Bilbro
 
The Promise and Peril of Very Big Models
The Promise and Peril of Very Big ModelsThe Promise and Peril of Very Big Models
The Promise and Peril of Very Big ModelsRebecca Bilbro
 
Beyond Off the-Shelf Consensus
Beyond Off the-Shelf ConsensusBeyond Off the-Shelf Consensus
Beyond Off the-Shelf ConsensusRebecca Bilbro
 
PyData Global: Thrifty Machine Learning
PyData Global: Thrifty Machine LearningPyData Global: Thrifty Machine Learning
PyData Global: Thrifty Machine LearningRebecca Bilbro
 
EuroSciPy 2019: Visual diagnostics at scale
EuroSciPy 2019: Visual diagnostics at scaleEuroSciPy 2019: Visual diagnostics at scale
EuroSciPy 2019: Visual diagnostics at scaleRebecca Bilbro
 
Visual diagnostics at scale
Visual diagnostics at scaleVisual diagnostics at scale
Visual diagnostics at scaleRebecca Bilbro
 
Steering Model Selection with Visual Diagnostics: Women in Analytics 2019
Steering Model Selection with Visual Diagnostics: Women in Analytics 2019Steering Model Selection with Visual Diagnostics: Women in Analytics 2019
Steering Model Selection with Visual Diagnostics: Women in Analytics 2019Rebecca Bilbro
 
A Visual Exploration of Distance, Documents, and Distributions
A Visual Exploration of Distance, Documents, and DistributionsA Visual Exploration of Distance, Documents, and Distributions
A Visual Exploration of Distance, Documents, and DistributionsRebecca Bilbro
 
The Incredible Disappearing Data Scientist
The Incredible Disappearing Data ScientistThe Incredible Disappearing Data Scientist
The Incredible Disappearing Data ScientistRebecca Bilbro
 
Learning machine learning with Yellowbrick
Learning machine learning with YellowbrickLearning machine learning with Yellowbrick
Learning machine learning with YellowbrickRebecca Bilbro
 
Escaping the Black Box
Escaping the Black BoxEscaping the Black Box
Escaping the Black BoxRebecca Bilbro
 
Data Intelligence 2017 - Building a Gigaword Corpus
Data Intelligence 2017 - Building a Gigaword CorpusData Intelligence 2017 - Building a Gigaword Corpus
Data Intelligence 2017 - Building a Gigaword CorpusRebecca Bilbro
 
Building a Gigaword Corpus (PyCon 2017)
Building a Gigaword Corpus (PyCon 2017)Building a Gigaword Corpus (PyCon 2017)
Building a Gigaword Corpus (PyCon 2017)Rebecca Bilbro
 
Yellowbrick: Steering machine learning with visual transformers
Yellowbrick: Steering machine learning with visual transformersYellowbrick: Steering machine learning with visual transformers
Yellowbrick: Steering machine learning with visual transformersRebecca Bilbro
 
Visualizing the model selection process
Visualizing the model selection processVisualizing the model selection process
Visualizing the model selection processRebecca Bilbro
 
NLP for Everyday People
NLP for Everyday PeopleNLP for Everyday People
NLP for Everyday PeopleRebecca Bilbro
 

More from Rebecca Bilbro (20)

Data Structures for Data Privacy: Lessons Learned in Production
Data Structures for Data Privacy: Lessons Learned in ProductionData Structures for Data Privacy: Lessons Learned in Production
Data Structures for Data Privacy: Lessons Learned in Production
 
Conflict-Free Replicated Data Types (PyCon 2022)
Conflict-Free Replicated Data Types (PyCon 2022)Conflict-Free Replicated Data Types (PyCon 2022)
Conflict-Free Replicated Data Types (PyCon 2022)
 
(Py)testing the Limits of Machine Learning
(Py)testing the Limits of Machine Learning(Py)testing the Limits of Machine Learning
(Py)testing the Limits of Machine Learning
 
The Promise and Peril of Very Big Models
The Promise and Peril of Very Big ModelsThe Promise and Peril of Very Big Models
The Promise and Peril of Very Big Models
 
Beyond Off the-Shelf Consensus
Beyond Off the-Shelf ConsensusBeyond Off the-Shelf Consensus
Beyond Off the-Shelf Consensus
 
PyData Global: Thrifty Machine Learning
PyData Global: Thrifty Machine LearningPyData Global: Thrifty Machine Learning
PyData Global: Thrifty Machine Learning
 
EuroSciPy 2019: Visual diagnostics at scale
EuroSciPy 2019: Visual diagnostics at scaleEuroSciPy 2019: Visual diagnostics at scale
EuroSciPy 2019: Visual diagnostics at scale
 
Visual diagnostics at scale
Visual diagnostics at scaleVisual diagnostics at scale
Visual diagnostics at scale
 
Steering Model Selection with Visual Diagnostics: Women in Analytics 2019
Steering Model Selection with Visual Diagnostics: Women in Analytics 2019Steering Model Selection with Visual Diagnostics: Women in Analytics 2019
Steering Model Selection with Visual Diagnostics: Women in Analytics 2019
 
A Visual Exploration of Distance, Documents, and Distributions
A Visual Exploration of Distance, Documents, and DistributionsA Visual Exploration of Distance, Documents, and Distributions
A Visual Exploration of Distance, Documents, and Distributions
 
Words in space
Words in spaceWords in space
Words in space
 
The Incredible Disappearing Data Scientist
The Incredible Disappearing Data ScientistThe Incredible Disappearing Data Scientist
The Incredible Disappearing Data Scientist
 
Camlis
CamlisCamlis
Camlis
 
Learning machine learning with Yellowbrick
Learning machine learning with YellowbrickLearning machine learning with Yellowbrick
Learning machine learning with Yellowbrick
 
Escaping the Black Box
Escaping the Black BoxEscaping the Black Box
Escaping the Black Box
 
Data Intelligence 2017 - Building a Gigaword Corpus
Data Intelligence 2017 - Building a Gigaword CorpusData Intelligence 2017 - Building a Gigaword Corpus
Data Intelligence 2017 - Building a Gigaword Corpus
 
Building a Gigaword Corpus (PyCon 2017)
Building a Gigaword Corpus (PyCon 2017)Building a Gigaword Corpus (PyCon 2017)
Building a Gigaword Corpus (PyCon 2017)
 
Yellowbrick: Steering machine learning with visual transformers
Yellowbrick: Steering machine learning with visual transformersYellowbrick: Steering machine learning with visual transformers
Yellowbrick: Steering machine learning with visual transformers
 
Visualizing the model selection process
Visualizing the model selection processVisualizing the model selection process
Visualizing the model selection process
 
NLP for Everyday People
NLP for Everyday PeopleNLP for Everyday People
NLP for Everyday People
 

Recently uploaded

HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 

Recently uploaded (20)

HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 

Anti-Entropy Replication for Cost-Effective Eventual Consistency

  • 1. Bilateral Anti-Entropy: Achieving Cost-Effective Eventual Consistency by Dr. Rebecca Bilbro Rotational Labs, LLC
  • 2. alpha bravo charlie delta echo Imagine a network of connected servers – a distributed system. They also make it more available, that is, responsive even to many simultaneous client requests. Each peer has a copy of the database and can respond independently. The servers are peers. Working together, they can make the system more tolerant to failures like earthquakes and outages.
  • 3. This means that the peers have to figure out how to synchronize independent updates to the data… set key X to value Y set key P to value Q alpha bravo … and sometimes they’ll have to resolve conflicts! set key M to value N set key M to value F alpha bravo
  • 4. alpha bravo The peers can’t see into each other’s copies of the database, so they have to communicate via remote procedure calls (RPCs) to share information. The communication has to be extremely efficient so the system doesn’t slow down too much while synchronization is happening. Note: This is a good use case for protocol buffers!
  • 5. The tradeoffs include things like: - staleness (how bad will it be if users sometimes see old data before it’s updated?) - expense (how many messages have to travel across the wire; how many clusters are we hosting?) strong causal eventual More consistency, higher latency, lower availability There are a number of ways to implement synchronization and achieve consensus, depending on how consistent the system needs to be.
  • 6. Eventual consistency is a good budget-friendly choice for applications that choose to prioritize higher availability and lower latency over consistency. alpha bravo M:N M:F time alpha bravo M:N M:N Given enough time to catch up on synchronizations, the system will eventually be fully consistent, meaning that every peer will eventually contain the same data objects.
  • 7. Anti-entropy (aka “gossip”) is a mechanism for achieving eventual consistency. It enables peers to periodically share their perspective of the data with another peer in the system. alpha bravo P:Q M:N D:F L:S P:Q v3 M:N v11 D:F v5 L:S v1 Alpha shares its current values for each object with bravo as well as each object’s version vector. Each time a peer gets a client request to update a value, it also increments the object’s version vector. Version vectors encode provenance and change history information.
  • 8. The version vector will allow bravo to compare the values it has for each object, and to decide whether or not to update them. bravo P:Q v3 M:N v11 D:F v5 L:S v1 P:Q v3 M:Z v10 D:F v5 If bravo has a smaller version number for an object compared to alpha, it knows it should update its local value. what alpha has what I have If bravo sees alpha has an object it doesn’t already know about, it can add it locally.
  • 9. What if alpha and bravo have different values for the same key, but the same version vector? In this case, bravo needs a tie-breaker. bravo D:F v5 D:B v5 what alpha has what I have Bravo will compare its global process id (PID) to alpha’s. If alpha’s PID is lower, bravo will update its local value for the object. PIDs are unique, so each peer is guaranteed to have a different number. alpha PID 1 PID 2
  • 10. With bilateral anti-entropy, we can enable alpha not only to share its data and version vectors with bravo, but also receive data and version vectors back from bravo. If alpha is initiating anti-entropy, it will begin by sharing its version vectors for all objects with bravo. This is known as the “push” phase. After it notifies bravo that the push phase is complete, alpha will receive data and version vectors from bravo, which is the “pull” phase. alpha bravo PID 2 PID 1 push pull
  • 11. As the receiver, bravo also experiences anti-entropy in multiple phases. First, bravo starts receiving version vectors for each of alpha’s objects. alpha bravo PID 2 PID 1 get version vectors
  • 12. Bravo then uses the version vectors to determine which objects to ask alpha for. alpha bravo PID 2 PID 1 request data
  • 13. Once bravo gets back this data from alpha, it can use it to make local repairs. alpha bravo PID 2 PID 1 get data
  • 14. As soon as bravo is notified that alpha’s push phase is complete, it determines which objects it has locally that alpha doesn’t yet know about, and sends those back to alpha. alpha bravo PID 2 PID 1 send repairs COMPLETE
  • 16. alpha bravo Why doesn’t alpha just send all the data for each object it has during the push phase? That would save me from having to ask for it later. Sending only version vectors is a lot cheaper! It reduces the size of messages across the wire.
  • 17. alpha bravo So why is it called a version “vector” then? In order to make the right changes (and make them in the right order), we need to communicate the count of updates an object has had as well as our PIDs (which express each of our perspectives in the system).
  • 18. alpha bravo charlie delta echo How do we know which peers to perform anti-entropy with? At least one peer needs to know about some other peers in the network to get anti-entropy started. That peer will select a peer at random to start “gossiping” with. As part of the anti-entropy process, peers can also tell each other about newly joined peers in the network (and their PIDs). PID 1 PID 2 PID 21 PID 42 PID 88
  • 19. delta echo How often should we gossip? That’s configurable. More gossip means more consistency at the price of more messages traveling across the network. charlie We could each have different anti-entropy intervals. We also have a configured “jitter” to prevent our anti-entropy sessions from all happening at the exact same time.