SlideShare une entreprise Scribd logo
1  sur  27
Distributed
Applications
Nodes = [ra@node1, ra@node2, ra@node3].
start_cluster("My raft cluster", Nodes).
2
WHY ?
3
Agenda
● Distribution
● Consistency
● Replication
● Distributed KV in Erlang
● Pause for QA
● Scaling
● Partitioning
● Observability
● QA
4
Microservices Distribution
● Microservices and data
● Brokers, databases, caching, point to point .. etc
● Ignoring/delegating the data-distributions
5
Microservices Data
Avoid single point of failure with a fault-tolerance system
6
High Availability <> Scaling
7
Data in distributed systems
It is impossible for a distributed data store to simultaneously provide
more than two out of the following three guarantees:
1 - Consistency: Every read receives the most recent write or an error
2 - Availability: Every request receives a (non-error) response – without
the guarantee that it contains the most recent write
3 - Partition tolerance: The system continues to operate despite an
arbitrary number of messages being dropped (or delayed) by the
network between node
8
Consistency
● Strong consistency
● Eventually consistency
9
Replica with sm
State machine replication ( deterministic )
Fault Tolerance with sm
Determinism is an ideal characteristic for providing fault-tolerance.
Intuitively, if multiple copies of a system exist, a fault in one would be
noticeable as a difference in the State or Output from the others.
10
Raft Protocol
Consensus algorithm
Consensus is a fundamental problem in fault-tolerant distributed
systems. Consensus involves multiple servers agreeing on values.
Once they reach a decision on a value, that decision is final.
Leader, Candidate(s), Follower(s)
(RabbitMQ uses it with the new queues “quorum”)
11
Leader/Master implementations
● Leader has the truth
● Leader handles all the calls
● Wrong entry on the Leader is distributed across the followers
● Need always the majority
12
Raft and RSM
Leader
Follower
Follower
Client
X = 3 X = 3
X = 3
X = 3Ok
13
Partitions
Leader
Follower
Follower
Client
X = 3 X = 3
X = 3
X = 3
Ok
Leader
Follower
Client
X = 6 X = 6
X = 6
ERROR
Follower
14
What about BEAM ?
● Cluster by design
● State machine by design ( gen_statem, process, immutable )
● Demo demo demo
15
End First Part
Any questions ?
16
Scaling...
● Vertical scaling
● Horizontal scaling
I put more HW, so the system is faster...
I create another docker machine... so the system is faster
If the design does not scale, the application won’t scale
If you are using the wrong tools, the application won’t scale
17
Scaling using partitioning
● Divide a single stream data in more partitions
● Partitions can be stored in different machines
● Partitions/shardings/queues (usually) are the units of scaling
THE UNIT OF SCALING <<----- the key
18
Partitioning Example
{category = “food”,
product = “wine”}
{category = “food”,
product = “pasta”}
{category = “Computer”,
product = “Dell” }
19
Partitioning Example
{category = “food”,
product = “wine”}
{category = “food”,
product = “pasta”}
{category = “Computer”,
product = “Dell” }
Partition 11
Partition 21
20
Partitioning and distribution
● Equal distribution problem
● Consistent hashing (partition hasing)
○ Language hash (object.hashCode())
○ Use UUID version 3, compatible
● Distribution by key (ex: A,B,C etc)
○ Won’t save… but
● Rebalance partitions
21
Joke about Partitioning Consistency
Mr. Poons:
How far into the future can you see, Mrs. Cake?
Mrs. Cake:
About ten seconds usually, Mr. Poons.
Mrs. Cake:
About ten seconds usually, Mr. Poons.
Mr. Poons:
How far into the future can you see, Mrs. Cake?
22
Read-only scaling clusters
Read-only replica query also called read-
only scaling architectural you may read an
old value, eventual consistency- read scaling is
cool but you could read old data ( cap theorem
about consistency)
23
Handle failures
● Failures in distributed systems are hard to understand
● Monitoring systems are not enough
● Metrics/Logs are not enough
● Crash: the best you can hope for
● Silent fails - When you get them it is (usually) late
● The message didn’t arrive
The message didn’t arrive!!!! -- let’s talk about ...
24
What I learnt
● Spend time on your design ( even some “methodology” says the
opposite)
● Avoid “spaghetti” design, divide in contexts ( or units of scaling)
● Write tests close to your environment and not only “how fast is”
● Add the right metrics, log, monitoring - anticipate the fails
● Client… too often overlooked
● Simulate failures constantly
● Study distributed systems.
● Predict the fail using ML ( Working on it in SUSE )
25
About ME
● Senior Developer @SUSE
● Work on OpenStack middleware modules
● RabbitMQ member/supporter
● Co-Author of RabbitMQ cookbook
● @gsantomaggio /twitter/github/IRC
No one is born hating another person because of
the color of his skin, or his background, or his
religion. People must learn to hate, and if they
can learn to hate, they can be taught to love, for
love comes more naturally to the human heart
than its opposite
Any questions?
You can find me at
@gsantomaggio
26
27
Not only data but also to nodes
https://blog.discordapp.com/scaling-elixir-f9b8e1e7c29b
Example I did
Different hashing type

Contenu connexe

Tendances

Checkpoint/restart in the userspace
Checkpoint/restart in the userspaceCheckpoint/restart in the userspace
Checkpoint/restart in the userspaceOpenVZ
 
Reader/writer problem
Reader/writer problemReader/writer problem
Reader/writer problemRinkuMonani
 
Multiprocessing -Interprocessing communication and process sunchronization,se...
Multiprocessing -Interprocessing communication and process sunchronization,se...Multiprocessing -Interprocessing communication and process sunchronization,se...
Multiprocessing -Interprocessing communication and process sunchronization,se...Neena R Krishna
 
Client-centric Consistency Models
Client-centric Consistency ModelsClient-centric Consistency Models
Client-centric Consistency ModelsEnsar Basri Kahveci
 
Glusterfs session #4 call frame and programming model
Glusterfs session #4   call frame and programming modelGlusterfs session #4   call frame and programming model
Glusterfs session #4 call frame and programming modelPranith Karampuri
 
Replay your workload as it is your actual one!
Replay your workload as it is your actual one! Replay your workload as it is your actual one!
Replay your workload as it is your actual one! Boris Hristov
 
Welcome to the nightmare of locking, blocking and isolation levels!
Welcome to the nightmare of locking, blocking and isolation levels!Welcome to the nightmare of locking, blocking and isolation levels!
Welcome to the nightmare of locking, blocking and isolation levels!Boris Hristov
 
Better IPSec Security Association Resolution - Netconf 2006 Tokyo
Better IPSec Security Association Resolution - Netconf 2006 TokyoBetter IPSec Security Association Resolution - Netconf 2006 Tokyo
Better IPSec Security Association Resolution - Netconf 2006 TokyoJames Morris
 
The Nightmare of Locking, Blocking and Isolation Levels!
The Nightmare of Locking, Blocking and Isolation Levels!The Nightmare of Locking, Blocking and Isolation Levels!
The Nightmare of Locking, Blocking and Isolation Levels!Boris Hristov
 
The nightmare of locking, blocking and isolation levels
The nightmare of locking, blocking and isolation levelsThe nightmare of locking, blocking and isolation levels
The nightmare of locking, blocking and isolation levelsBoris Hristov
 
The nightmare of locking, blocking and isolation levels!
The nightmare of locking, blocking and isolation levels!The nightmare of locking, blocking and isolation levels!
The nightmare of locking, blocking and isolation levels!Boris Hristov
 
An End to Order (many cores with java, session two)
An End to Order (many cores with java, session two)An End to Order (many cores with java, session two)
An End to Order (many cores with java, session two)Robert Burrell Donkin
 
Usp message queues
Usp message queuesUsp message queues
Usp message queuesRohitK71
 

Tendances (18)

Checkpoint/restart in the userspace
Checkpoint/restart in the userspaceCheckpoint/restart in the userspace
Checkpoint/restart in the userspace
 
Reader/writer problem
Reader/writer problemReader/writer problem
Reader/writer problem
 
Multiprocessing -Interprocessing communication and process sunchronization,se...
Multiprocessing -Interprocessing communication and process sunchronization,se...Multiprocessing -Interprocessing communication and process sunchronization,se...
Multiprocessing -Interprocessing communication and process sunchronization,se...
 
Client-centric Consistency Models
Client-centric Consistency ModelsClient-centric Consistency Models
Client-centric Consistency Models
 
Cache scope
Cache scopeCache scope
Cache scope
 
Glusterfs session #4 call frame and programming model
Glusterfs session #4   call frame and programming modelGlusterfs session #4   call frame and programming model
Glusterfs session #4 call frame and programming model
 
Cache scope
Cache scopeCache scope
Cache scope
 
Jactor for Dummies
Jactor for DummiesJactor for Dummies
Jactor for Dummies
 
Replay your workload as it is your actual one!
Replay your workload as it is your actual one! Replay your workload as it is your actual one!
Replay your workload as it is your actual one!
 
Welcome to the nightmare of locking, blocking and isolation levels!
Welcome to the nightmare of locking, blocking and isolation levels!Welcome to the nightmare of locking, blocking and isolation levels!
Welcome to the nightmare of locking, blocking and isolation levels!
 
Concurrency
ConcurrencyConcurrency
Concurrency
 
Better IPSec Security Association Resolution - Netconf 2006 Tokyo
Better IPSec Security Association Resolution - Netconf 2006 TokyoBetter IPSec Security Association Resolution - Netconf 2006 Tokyo
Better IPSec Security Association Resolution - Netconf 2006 Tokyo
 
The Nightmare of Locking, Blocking and Isolation Levels!
The Nightmare of Locking, Blocking and Isolation Levels!The Nightmare of Locking, Blocking and Isolation Levels!
The Nightmare of Locking, Blocking and Isolation Levels!
 
The nightmare of locking, blocking and isolation levels
The nightmare of locking, blocking and isolation levelsThe nightmare of locking, blocking and isolation levels
The nightmare of locking, blocking and isolation levels
 
The nightmare of locking, blocking and isolation levels!
The nightmare of locking, blocking and isolation levels!The nightmare of locking, blocking and isolation levels!
The nightmare of locking, blocking and isolation levels!
 
An End to Order (many cores with java, session two)
An End to Order (many cores with java, session two)An End to Order (many cores with java, session two)
An End to Order (many cores with java, session two)
 
An End to Order
An End to OrderAn End to Order
An End to Order
 
Usp message queues
Usp message queuesUsp message queues
Usp message queues
 

Similaire à Distruted applications

Retaining Goodput with Query Rate Limiting
Retaining Goodput with Query Rate LimitingRetaining Goodput with Query Rate Limiting
Retaining Goodput with Query Rate LimitingScyllaDB
 
20230511 - PGConf Nepal - Clustering in PostgreSQL_ Because one database serv...
20230511 - PGConf Nepal - Clustering in PostgreSQL_ Because one database serv...20230511 - PGConf Nepal - Clustering in PostgreSQL_ Because one database serv...
20230511 - PGConf Nepal - Clustering in PostgreSQL_ Because one database serv...Umair Shahid
 
Strata+Hadoop 2017 San Jose: Lessons from a year of supporting Apache Kafka
Strata+Hadoop 2017 San Jose: Lessons from a year of supporting Apache KafkaStrata+Hadoop 2017 San Jose: Lessons from a year of supporting Apache Kafka
Strata+Hadoop 2017 San Jose: Lessons from a year of supporting Apache Kafkaconfluent
 
Reliability and Resilience Patterns
Reliability and Resilience PatternsReliability and Resilience Patterns
Reliability and Resilience PatternsDmitry Chornyi
 
Distributed systems and scalability rules
Distributed systems and scalability rulesDistributed systems and scalability rules
Distributed systems and scalability rulesOleg Tsal-Tsalko
 
Reactive by example (DevOpsDaysTLV 2019)
Reactive by example (DevOpsDaysTLV 2019)Reactive by example (DevOpsDaysTLV 2019)
Reactive by example (DevOpsDaysTLV 2019)Eran Harel
 
Performance tuning Grails applications SpringOne 2GX 2014
Performance tuning Grails applications SpringOne 2GX 2014Performance tuning Grails applications SpringOne 2GX 2014
Performance tuning Grails applications SpringOne 2GX 2014Lari Hotari
 
Clustering in PostgreSQL - Because one database server is never enough (and n...
Clustering in PostgreSQL - Because one database server is never enough (and n...Clustering in PostgreSQL - Because one database server is never enough (and n...
Clustering in PostgreSQL - Because one database server is never enough (and n...Umair Shahid
 
Retaining Goodput with Query Rate Limiting
Retaining Goodput with Query Rate LimitingRetaining Goodput with Query Rate Limiting
Retaining Goodput with Query Rate LimitingScyllaDB
 
Webinar slides: 9 DevOps Tips for Going in Production with Galera Cluster for...
Webinar slides: 9 DevOps Tips for Going in Production with Galera Cluster for...Webinar slides: 9 DevOps Tips for Going in Production with Galera Cluster for...
Webinar slides: 9 DevOps Tips for Going in Production with Galera Cluster for...Severalnines
 
Series of Unfortunate Netflix Container Events - QConNYC17
Series of Unfortunate Netflix Container Events - QConNYC17Series of Unfortunate Netflix Container Events - QConNYC17
Series of Unfortunate Netflix Container Events - QConNYC17aspyker
 
Design (Cloud systems) for Failures
Design (Cloud systems) for FailuresDesign (Cloud systems) for Failures
Design (Cloud systems) for FailuresRodolfo Kohn
 
Fault tolerance - look, it's simple!
Fault tolerance - look, it's simple!Fault tolerance - look, it's simple!
Fault tolerance - look, it's simple!Izzet Mustafaiev
 
UEMB210: Software Delivery: Best Practices
UEMB210: Software Delivery: Best PracticesUEMB210: Software Delivery: Best Practices
UEMB210: Software Delivery: Best PracticesIvanti
 
Distributed Systems: scalability and high availability
Distributed Systems: scalability and high availabilityDistributed Systems: scalability and high availability
Distributed Systems: scalability and high availabilityRenato Lucindo
 
Overview of Site Reliability Engineering (SRE) & best practices
Overview of Site Reliability Engineering (SRE) & best practicesOverview of Site Reliability Engineering (SRE) & best practices
Overview of Site Reliability Engineering (SRE) & best practicesAshutosh Agarwal
 
Non-Kafkaesque Apache Kafka - Yottabyte 2018
Non-Kafkaesque Apache Kafka - Yottabyte 2018Non-Kafkaesque Apache Kafka - Yottabyte 2018
Non-Kafkaesque Apache Kafka - Yottabyte 2018Otávio Carvalho
 
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & PythonCassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & PythonDataStax Academy
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSKathirvel Ayyaswamy
 

Similaire à Distruted applications (20)

Retaining Goodput with Query Rate Limiting
Retaining Goodput with Query Rate LimitingRetaining Goodput with Query Rate Limiting
Retaining Goodput with Query Rate Limiting
 
20230511 - PGConf Nepal - Clustering in PostgreSQL_ Because one database serv...
20230511 - PGConf Nepal - Clustering in PostgreSQL_ Because one database serv...20230511 - PGConf Nepal - Clustering in PostgreSQL_ Because one database serv...
20230511 - PGConf Nepal - Clustering in PostgreSQL_ Because one database serv...
 
Strata+Hadoop 2017 San Jose: Lessons from a year of supporting Apache Kafka
Strata+Hadoop 2017 San Jose: Lessons from a year of supporting Apache KafkaStrata+Hadoop 2017 San Jose: Lessons from a year of supporting Apache Kafka
Strata+Hadoop 2017 San Jose: Lessons from a year of supporting Apache Kafka
 
SVCC-2014
SVCC-2014SVCC-2014
SVCC-2014
 
Reliability and Resilience Patterns
Reliability and Resilience PatternsReliability and Resilience Patterns
Reliability and Resilience Patterns
 
Distributed systems and scalability rules
Distributed systems and scalability rulesDistributed systems and scalability rules
Distributed systems and scalability rules
 
Reactive by example (DevOpsDaysTLV 2019)
Reactive by example (DevOpsDaysTLV 2019)Reactive by example (DevOpsDaysTLV 2019)
Reactive by example (DevOpsDaysTLV 2019)
 
Performance tuning Grails applications SpringOne 2GX 2014
Performance tuning Grails applications SpringOne 2GX 2014Performance tuning Grails applications SpringOne 2GX 2014
Performance tuning Grails applications SpringOne 2GX 2014
 
Clustering in PostgreSQL - Because one database server is never enough (and n...
Clustering in PostgreSQL - Because one database server is never enough (and n...Clustering in PostgreSQL - Because one database server is never enough (and n...
Clustering in PostgreSQL - Because one database server is never enough (and n...
 
Retaining Goodput with Query Rate Limiting
Retaining Goodput with Query Rate LimitingRetaining Goodput with Query Rate Limiting
Retaining Goodput with Query Rate Limiting
 
Webinar slides: 9 DevOps Tips for Going in Production with Galera Cluster for...
Webinar slides: 9 DevOps Tips for Going in Production with Galera Cluster for...Webinar slides: 9 DevOps Tips for Going in Production with Galera Cluster for...
Webinar slides: 9 DevOps Tips for Going in Production with Galera Cluster for...
 
Series of Unfortunate Netflix Container Events - QConNYC17
Series of Unfortunate Netflix Container Events - QConNYC17Series of Unfortunate Netflix Container Events - QConNYC17
Series of Unfortunate Netflix Container Events - QConNYC17
 
Design (Cloud systems) for Failures
Design (Cloud systems) for FailuresDesign (Cloud systems) for Failures
Design (Cloud systems) for Failures
 
Fault tolerance - look, it's simple!
Fault tolerance - look, it's simple!Fault tolerance - look, it's simple!
Fault tolerance - look, it's simple!
 
UEMB210: Software Delivery: Best Practices
UEMB210: Software Delivery: Best PracticesUEMB210: Software Delivery: Best Practices
UEMB210: Software Delivery: Best Practices
 
Distributed Systems: scalability and high availability
Distributed Systems: scalability and high availabilityDistributed Systems: scalability and high availability
Distributed Systems: scalability and high availability
 
Overview of Site Reliability Engineering (SRE) & best practices
Overview of Site Reliability Engineering (SRE) & best practicesOverview of Site Reliability Engineering (SRE) & best practices
Overview of Site Reliability Engineering (SRE) & best practices
 
Non-Kafkaesque Apache Kafka - Yottabyte 2018
Non-Kafkaesque Apache Kafka - Yottabyte 2018Non-Kafkaesque Apache Kafka - Yottabyte 2018
Non-Kafkaesque Apache Kafka - Yottabyte 2018
 
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & PythonCassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 

Dernier

CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSrknatarajan
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdfSuman Jyoti
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Christo Ananth
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLManishPatel169454
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01KreezheaRecto
 

Dernier (20)

CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 

Distruted applications

  • 1. Distributed Applications Nodes = [ra@node1, ra@node2, ra@node3]. start_cluster("My raft cluster", Nodes).
  • 3. 3 Agenda ● Distribution ● Consistency ● Replication ● Distributed KV in Erlang ● Pause for QA ● Scaling ● Partitioning ● Observability ● QA
  • 4. 4 Microservices Distribution ● Microservices and data ● Brokers, databases, caching, point to point .. etc ● Ignoring/delegating the data-distributions
  • 5. 5 Microservices Data Avoid single point of failure with a fault-tolerance system
  • 7. 7 Data in distributed systems It is impossible for a distributed data store to simultaneously provide more than two out of the following three guarantees: 1 - Consistency: Every read receives the most recent write or an error 2 - Availability: Every request receives a (non-error) response – without the guarantee that it contains the most recent write 3 - Partition tolerance: The system continues to operate despite an arbitrary number of messages being dropped (or delayed) by the network between node
  • 9. 9 Replica with sm State machine replication ( deterministic ) Fault Tolerance with sm Determinism is an ideal characteristic for providing fault-tolerance. Intuitively, if multiple copies of a system exist, a fault in one would be noticeable as a difference in the State or Output from the others.
  • 10. 10 Raft Protocol Consensus algorithm Consensus is a fundamental problem in fault-tolerant distributed systems. Consensus involves multiple servers agreeing on values. Once they reach a decision on a value, that decision is final. Leader, Candidate(s), Follower(s) (RabbitMQ uses it with the new queues “quorum”)
  • 11. 11 Leader/Master implementations ● Leader has the truth ● Leader handles all the calls ● Wrong entry on the Leader is distributed across the followers ● Need always the majority
  • 13. 13 Partitions Leader Follower Follower Client X = 3 X = 3 X = 3 X = 3 Ok Leader Follower Client X = 6 X = 6 X = 6 ERROR Follower
  • 14. 14 What about BEAM ? ● Cluster by design ● State machine by design ( gen_statem, process, immutable ) ● Demo demo demo
  • 15. 15 End First Part Any questions ?
  • 16. 16 Scaling... ● Vertical scaling ● Horizontal scaling I put more HW, so the system is faster... I create another docker machine... so the system is faster If the design does not scale, the application won’t scale If you are using the wrong tools, the application won’t scale
  • 17. 17 Scaling using partitioning ● Divide a single stream data in more partitions ● Partitions can be stored in different machines ● Partitions/shardings/queues (usually) are the units of scaling THE UNIT OF SCALING <<----- the key
  • 18. 18 Partitioning Example {category = “food”, product = “wine”} {category = “food”, product = “pasta”} {category = “Computer”, product = “Dell” }
  • 19. 19 Partitioning Example {category = “food”, product = “wine”} {category = “food”, product = “pasta”} {category = “Computer”, product = “Dell” } Partition 11 Partition 21
  • 20. 20 Partitioning and distribution ● Equal distribution problem ● Consistent hashing (partition hasing) ○ Language hash (object.hashCode()) ○ Use UUID version 3, compatible ● Distribution by key (ex: A,B,C etc) ○ Won’t save… but ● Rebalance partitions
  • 21. 21 Joke about Partitioning Consistency Mr. Poons: How far into the future can you see, Mrs. Cake? Mrs. Cake: About ten seconds usually, Mr. Poons. Mrs. Cake: About ten seconds usually, Mr. Poons. Mr. Poons: How far into the future can you see, Mrs. Cake?
  • 22. 22 Read-only scaling clusters Read-only replica query also called read- only scaling architectural you may read an old value, eventual consistency- read scaling is cool but you could read old data ( cap theorem about consistency)
  • 23. 23 Handle failures ● Failures in distributed systems are hard to understand ● Monitoring systems are not enough ● Metrics/Logs are not enough ● Crash: the best you can hope for ● Silent fails - When you get them it is (usually) late ● The message didn’t arrive The message didn’t arrive!!!! -- let’s talk about ...
  • 24. 24 What I learnt ● Spend time on your design ( even some “methodology” says the opposite) ● Avoid “spaghetti” design, divide in contexts ( or units of scaling) ● Write tests close to your environment and not only “how fast is” ● Add the right metrics, log, monitoring - anticipate the fails ● Client… too often overlooked ● Simulate failures constantly ● Study distributed systems. ● Predict the fail using ML ( Working on it in SUSE )
  • 25. 25 About ME ● Senior Developer @SUSE ● Work on OpenStack middleware modules ● RabbitMQ member/supporter ● Co-Author of RabbitMQ cookbook ● @gsantomaggio /twitter/github/IRC
  • 26. No one is born hating another person because of the color of his skin, or his background, or his religion. People must learn to hate, and if they can learn to hate, they can be taught to love, for love comes more naturally to the human heart than its opposite Any questions? You can find me at @gsantomaggio 26
  • 27. 27 Not only data but also to nodes https://blog.discordapp.com/scaling-elixir-f9b8e1e7c29b Example I did Different hashing type

Notes de l'éditeur

  1. Why this talk We usually delegate the distributed problems to someone else
  2. Programmers want to use only frameworks We are losing the contact with primitive Lot of the stuff we will speak are from 90th
  3. Questions: Other ways to integrate them? You just write the service It is devops fault You just write the serv
  4. Ok so you services running, but since you use it is supposed to use a HA system, else why you use it?
  5. Scaling does not mean High Availability High Availability could be slower than single node application Do you know the difference?
  6. CAP Theorem Do you know what is this? Strong consistency or eventual consistency, sync or async
  7. Given a time X and you read a value from two different servers Strong = you must read always the correct data or error Eventually = you can read two different value, but eventually will be the same
  8. State machine replication on deterministic way A set of States, Inputs,Outputs Fault Tolerance, what does mean? Why it is important do understand what kind of the replica you need You need an entry point to do that
  9. From chain replication to fanout replication
  10. Slide raft About bizantine fault More mirroring more
  11. Slide raft
  12. Five nodes in split brain Speak also about eventual consistent systems
  13. Clustering is by design Deterministic machine status by with gen_statem
  14. I love this sentence “I add another machine so I can scale” The story of one queue and a big machine History about unexpected scaling ( RabbitMQ as XMPP) If you SW can’t handle the threads in the correct way, you won’t scale
  15. Bottleneck is when you reach the limit of your unit of scale
  16. Partitioning also called sharing it depedns In rabbitmq -> more queues, kafka by default, database sharing with multi index The partitioning is up to you
  17. Unbalanced partitions are around the corner Confusion about terms, consistent hashing/partition hashing
  18. Timing problem, when you read in more partitions in non consistent way
  19. Timing problem, when you read in more partitions in non consistent way
  20. Several component can contrite Example on SSL socket error in OpenStack or Segmentation fault error Silent fails the worst, you don’t see any visible problem, BUT only somethig strange About the message == mystical
  21. RAbbitMQ as XMPP Example with CPU