SlideShare a Scribd company logo
1 of 49
Download to read offline
Dennis van der Stelt
of distributed systems
Dennis van der Stelt
http://dennis.bloggingabout.net/
dennis@bloggingabout.net
Software Engineer at Particular Software
PRINCIPLES
Dennis van der Stelt
AGENDA
Dennis van der Stelt
Dennis van der Stelt
“A distributed system is a software
system in which components located
on networked computers
communicate and coordinate their
actions by passing messages.”
what is a distributed system
Wikipedia
Dennis van der Stelt
Working distributed…
Dennis van der Stelt
How hard can it be?
Dennis van der Stelt
FALLACIES OF DISTRIBUTED COMPUTING
PeterDeutsch& othersat Sun Microsystems, 1994
Latency is zero02
Topology doesn’t change05
There is one administrator06
The network is reliable01
Bandwidth is infinite03 Transport cost is zero07
The network is secure04 The network is homogeneous08
Dennis van der Stelt
Free eBook: Dr. Harvey and
the 8 Fallacies of Distributed
Computing
Dennis van der Stelt
The network is reliable
Dennis van der Stelt
STORE AND FORWARD WITH MSMQ
Store locally and pass ontotheinfrastructure
SQL Server
Dennis van der Stelt
using (var scope = new TransactionScope()))
{
var queue = new
MessageQueue(@".Private$Customers");
var message = queue.Receive();
var con = new SqlConnection();
var cmd = new SqlCommand("update customers ...");
cmd.ExecuteNonQuery();
}
DISTRIBUTED TRANSACTIONS
Microsoft DistributedTransactionCoordinator(MSDTC)
Code
Dennis van der Stelt
using (var scope = new TransactionScope()))
{
var queue = new
MessageQueue(@".Private$Customers");
var message = queue.Receive();
var con = new SqlConnection();
var cmd = new SqlCommand("update customers ...");
cmd.ExecuteNonQuery();
}
DISTRIBUTED TRANSACTIONS
Microsoft DistributedTransactionCoordinator(MSDTC)
Code
MSDTC
Dennis van der Stelt
Dennis van der Stelt
Distributed Transactions
Dennis van der Stelt
DISTRIBUTED TRANSACTIONS
The source of a lot of pain
RM
RM
RM
RM
RM
RM
RM
“Serializable is the highest isolation level. It makes sure that data that
anything you have a lock on, is locked for reading by others.”
Peter Bailis
Dennis van der Stelt
STORE AND FORWARD WITH MSMQ
Store locally and pass ontotheinfrastructure
SQL Server
Dennis van der Stelt
Handle(CreateClaimCommand msg)
{
dbContext.Claims.Add(Mapper.Map<Claim>(msg));
dbContext.SaveChanges();
Bus.Publish(new ClaimCreatedEvent());
}
DISTRIBUTED TRANSACTIONS WITH NSERVICEBUS
Microsoft DistributedTransactionCoordinator(MSDTC)
Code
Sends email to
customer
Dennis van der Stelt
Dennis van der Stelt
NOSQL
Dennis van der Stelt
CAP Theorem
Eric Brewer, PODC Conference 2000
Dennis van der Stelt
CAP THEOREM
You can only pick 2
Dennis van der Stelt
CAP THEOREM
You can only pick 2
centralized
system
partition tolerantconsistencyavailability
Dennis van der Stelt
CAP THEOREM
You can only pick 2
centralized
system
partition tolerantconsistencyavailability
Dennis van der Stelt
CAP THEOREM
You can only pick 2
centralized
system
partition tolerantconsistencyavailability
distributed
system
partition tolerantconsistencyavailability
Dennis van der Stelt
CAP THEOREM
You can only pick 2
centralized
system
partition tolerantconsistencyavailability
distributed
system
partition tolerantconsistencyavailability
when there’s network partition,
which do you sacrifice?
Dennis van der Stelt
Match the business perspective
Dennis van der Stelt
Dennis van der Stelt
Dennis van der Stelt
Dennis van der Stelt
Dennis van der Stelt
But I can’t drop consistency!
Dennis van der Stelt
Basically Available
BASE
What is BASE?
Soft state
Eventually consistent
Dennis van der Stelt
Eventual Consistency
Because 100% consistency isn’t the only option
Dennis van der Stelt
Dennis van der Stelt
Eventual Consistency
Dennis van der Stelt
Eventual Consistency
Dennis van der Stelt
Eventual Consistency
your “enterprise” is already eventual consistent with reality
Dennis van der Stelt
Eventual Consistency
your “enterprise” is already eventual consistent with reality
Dennis van der Stelt
“Allow things to be inconsistent and find ways to
compensate for mistakes, versus trying to prevent
mistakes altogether.”
EVENTUAL CONSISTENCY
Eric Brewer
VP of Infrastructure at Google, Professor at UC Berkeley
Dennis van der Stelt
100% synchronized
that‘s eventual consistency.
Udi Dahanin 2010
Dennis van der Stelt45
Idempotence
Once and only once delivery is hard!
Dennis van der Stelt
Dennis van der Stelt
IDEMPOTENCE
Solving the distributedtransactionissues
Sender
{0C836F44-6587-416E-B97A-5615615600D5}
Dennis van der Stelt
IDEMPOTENCE
Solving the distributedtransactionissues
Sender
{0C836F44-6587-416E-B97A-5615615600D5}
Dennis van der Stelt
IDEMPOTENCE
Solving the distributedtransactionissues
Sender
Event
Subscriber
{5EDC4993-AB01-4F17-A238-71C4521F750F}
{0C836F44-6587-416E-B97A-5615615600D5}
Dennis van der Stelt
IDEMPOTENCE
Solving the distributedtransactionissues
Sender
Event
Subscriber
{5EDC4993-AB01-4F17-A238-71C4521F750F}
{0C836F44-6587-416E-B97A-5615615600D5}
Dennis van der Stelt
Distributed Systems Principles
 8 Fallacies of distributed computing
 (Distributed) Transactions
 CAP Theorem & Eventual consistency
 Idempotence & outbox pattern
Dennis van der Stelt
Free eBook: Dr. Harvey and
the 8 Fallacies of Distributed
Computing
http://go.particular.net/ndclondon16
Dennis van der Stelt
find me.
http://dennis.bloggingabout.net
dvdstelt@outlook.com

More Related Content

Viewers also liked

Mciro Services & Zookeeper
Mciro Services & ZookeeperMciro Services & Zookeeper
Mciro Services & ZookeeperDeepak Singhal
 
Zookeeper at the bigdata roundtable
Zookeeper at the bigdata roundtableZookeeper at the bigdata roundtable
Zookeeper at the bigdata roundtableTobias Schlottke
 
基于Zookeeper的配置信息存储方案的设计与实现
基于Zookeeper的配置信息存储方案的设计与实现基于Zookeeper的配置信息存储方案的设计与实现
基于Zookeeper的配置信息存储方案的设计与实现billowqiu
 
Zookeeper
ZookeeperZookeeper
Zookeeperltsllc
 
zookeeper-internals
zookeeper-internalszookeeper-internals
zookeeper-internalsLiu Shaohui
 
Apache ZooKeeper TechTuesday
Apache ZooKeeper TechTuesdayApache ZooKeeper TechTuesday
Apache ZooKeeper TechTuesdayAndrei Savu
 
ZooKeeper Partitioning - A project report
ZooKeeper Partitioning - A project reportZooKeeper Partitioning - A project report
ZooKeeper Partitioning - A project reportpramodbiligiri
 
Jcconf 2016 zookeeper
Jcconf 2016 zookeeperJcconf 2016 zookeeper
Jcconf 2016 zookeeperMatt Ho
 
Zookeeper In Action
Zookeeper In ActionZookeeper In Action
Zookeeper In Actionjuvenxu
 
Zoo keeper in the wild
Zoo keeper in the wildZoo keeper in the wild
Zoo keeper in the wilddatamantra
 
使用ZooKeeper打造軟體式負載平衡
使用ZooKeeper打造軟體式負載平衡使用ZooKeeper打造軟體式負載平衡
使用ZooKeeper打造軟體式負載平衡Lawrence Huang
 
Apache Zookeeper 分布式服务框架
Apache Zookeeper 分布式服务框架Apache Zookeeper 分布式服务框架
Apache Zookeeper 分布式服务框架Cabin WJ
 
Introduction to Apache ZooKeeper
Introduction to Apache ZooKeeperIntroduction to Apache ZooKeeper
Introduction to Apache ZooKeeperknowbigdata
 
Introduction to apache zoo keeper
Introduction to apache zoo keeper Introduction to apache zoo keeper
Introduction to apache zoo keeper Omid Vahdaty
 
Zookeeper In Simple Words
Zookeeper In Simple WordsZookeeper In Simple Words
Zookeeper In Simple WordsFuqiang Wang
 
The Distributed & Decentralized Cloud
The Distributed & Decentralized CloudThe Distributed & Decentralized Cloud
The Distributed & Decentralized CloudMargaret Dawson
 
Introduction to ZooKeeper - TriHUG May 22, 2012
Introduction to ZooKeeper - TriHUG May 22, 2012Introduction to ZooKeeper - TriHUG May 22, 2012
Introduction to ZooKeeper - TriHUG May 22, 2012mumrah
 

Viewers also liked (20)

Zookeeper
ZookeeperZookeeper
Zookeeper
 
Mciro Services & Zookeeper
Mciro Services & ZookeeperMciro Services & Zookeeper
Mciro Services & Zookeeper
 
Zookeeper at the bigdata roundtable
Zookeeper at the bigdata roundtableZookeeper at the bigdata roundtable
Zookeeper at the bigdata roundtable
 
基于Zookeeper的配置信息存储方案的设计与实现
基于Zookeeper的配置信息存储方案的设计与实现基于Zookeeper的配置信息存储方案的设计与实现
基于Zookeeper的配置信息存储方案的设计与实现
 
Zookeeper
ZookeeperZookeeper
Zookeeper
 
zookeeper-internals
zookeeper-internalszookeeper-internals
zookeeper-internals
 
ZooKeeper Futures
ZooKeeper FuturesZooKeeper Futures
ZooKeeper Futures
 
Apache ZooKeeper TechTuesday
Apache ZooKeeper TechTuesdayApache ZooKeeper TechTuesday
Apache ZooKeeper TechTuesday
 
ZooKeeper Partitioning - A project report
ZooKeeper Partitioning - A project reportZooKeeper Partitioning - A project report
ZooKeeper Partitioning - A project report
 
Jcconf 2016 zookeeper
Jcconf 2016 zookeeperJcconf 2016 zookeeper
Jcconf 2016 zookeeper
 
Zookeeper In Action
Zookeeper In ActionZookeeper In Action
Zookeeper In Action
 
Zookeeper
ZookeeperZookeeper
Zookeeper
 
Zoo keeper in the wild
Zoo keeper in the wildZoo keeper in the wild
Zoo keeper in the wild
 
使用ZooKeeper打造軟體式負載平衡
使用ZooKeeper打造軟體式負載平衡使用ZooKeeper打造軟體式負載平衡
使用ZooKeeper打造軟體式負載平衡
 
Apache Zookeeper 分布式服务框架
Apache Zookeeper 分布式服务框架Apache Zookeeper 分布式服务框架
Apache Zookeeper 分布式服务框架
 
Introduction to Apache ZooKeeper
Introduction to Apache ZooKeeperIntroduction to Apache ZooKeeper
Introduction to Apache ZooKeeper
 
Introduction to apache zoo keeper
Introduction to apache zoo keeper Introduction to apache zoo keeper
Introduction to apache zoo keeper
 
Zookeeper In Simple Words
Zookeeper In Simple WordsZookeeper In Simple Words
Zookeeper In Simple Words
 
The Distributed & Decentralized Cloud
The Distributed & Decentralized CloudThe Distributed & Decentralized Cloud
The Distributed & Decentralized Cloud
 
Introduction to ZooKeeper - TriHUG May 22, 2012
Introduction to ZooKeeper - TriHUG May 22, 2012Introduction to ZooKeeper - TriHUG May 22, 2012
Introduction to ZooKeeper - TriHUG May 22, 2012
 

Similar to Distributed Systems Principles

Distributed computing for new bloods
Distributed computing for new bloodsDistributed computing for new bloods
Distributed computing for new bloodsRaymond Tay
 
Intro to Distributed Database Management System
Intro to Distributed Database Management SystemIntro to Distributed Database Management System
Intro to Distributed Database Management SystemAli Raza
 
Real Security in a Virtual Environment
Real Security in a Virtual EnvironmentReal Security in a Virtual Environment
Real Security in a Virtual EnvironmentMattias Geniar
 
Layer-2 after “The Merge”
Layer-2 after “The Merge”Layer-2 after “The Merge”
Layer-2 after “The Merge”Jiyun Kim
 
Phreebird Suite 1.0: Introducing the Domain Key Infrastructure
Phreebird Suite 1.0:  Introducing the Domain Key InfrastructurePhreebird Suite 1.0:  Introducing the Domain Key Infrastructure
Phreebird Suite 1.0: Introducing the Domain Key InfrastructureDan Kaminsky
 
Michalesoft dds-diskless-education-problem-benefits-2012
Michalesoft dds-diskless-education-problem-benefits-2012Michalesoft dds-diskless-education-problem-benefits-2012
Michalesoft dds-diskless-education-problem-benefits-2012damiendds
 
Lecture 1-introduction to distributed computing.pptx
Lecture 1-introduction to distributed computing.pptxLecture 1-introduction to distributed computing.pptx
Lecture 1-introduction to distributed computing.pptxssusere05ec21
 
The Power of Determinism in Database Systems
The Power of Determinism in Database SystemsThe Power of Determinism in Database Systems
The Power of Determinism in Database SystemsDaniel Abadi
 
Dok Talks #122 - Operationalizing a Data Infrastructure Stack on Kubernetes
Dok Talks #122 - Operationalizing a Data Infrastructure Stack on KubernetesDok Talks #122 - Operationalizing a Data Infrastructure Stack on Kubernetes
Dok Talks #122 - Operationalizing a Data Infrastructure Stack on KubernetesDoKC
 
Cs 704 d set4distributedcomputing-1funda
Cs 704 d set4distributedcomputing-1fundaCs 704 d set4distributedcomputing-1funda
Cs 704 d set4distributedcomputing-1fundaDebasis Das
 

Similar to Distributed Systems Principles (17)

DNA Cloud Backup
DNA Cloud BackupDNA Cloud Backup
DNA Cloud Backup
 
Chap 01v2
Chap 01v2Chap 01v2
Chap 01v2
 
Distributed computing for new bloods
Distributed computing for new bloodsDistributed computing for new bloods
Distributed computing for new bloods
 
SDN Abstractions
SDN AbstractionsSDN Abstractions
SDN Abstractions
 
Intro to Distributed Database Management System
Intro to Distributed Database Management SystemIntro to Distributed Database Management System
Intro to Distributed Database Management System
 
Interview Questions
Interview QuestionsInterview Questions
Interview Questions
 
A Xen Case Study
A Xen Case StudyA Xen Case Study
A Xen Case Study
 
MSB-Distributed systems goals
MSB-Distributed systems goalsMSB-Distributed systems goals
MSB-Distributed systems goals
 
Real Security in a Virtual Environment
Real Security in a Virtual EnvironmentReal Security in a Virtual Environment
Real Security in a Virtual Environment
 
Layer-2 after “The Merge”
Layer-2 after “The Merge”Layer-2 after “The Merge”
Layer-2 after “The Merge”
 
Phreebird Suite 1.0: Introducing the Domain Key Infrastructure
Phreebird Suite 1.0:  Introducing the Domain Key InfrastructurePhreebird Suite 1.0:  Introducing the Domain Key Infrastructure
Phreebird Suite 1.0: Introducing the Domain Key Infrastructure
 
Michalesoft dds-diskless-education-problem-benefits-2012
Michalesoft dds-diskless-education-problem-benefits-2012Michalesoft dds-diskless-education-problem-benefits-2012
Michalesoft dds-diskless-education-problem-benefits-2012
 
Lecture 1-introduction to distributed computing.pptx
Lecture 1-introduction to distributed computing.pptxLecture 1-introduction to distributed computing.pptx
Lecture 1-introduction to distributed computing.pptx
 
The Power of Determinism in Database Systems
The Power of Determinism in Database SystemsThe Power of Determinism in Database Systems
The Power of Determinism in Database Systems
 
Dok Talks #122 - Operationalizing a Data Infrastructure Stack on Kubernetes
Dok Talks #122 - Operationalizing a Data Infrastructure Stack on KubernetesDok Talks #122 - Operationalizing a Data Infrastructure Stack on Kubernetes
Dok Talks #122 - Operationalizing a Data Infrastructure Stack on Kubernetes
 
Dsm presentation (english)
Dsm presentation (english)Dsm presentation (english)
Dsm presentation (english)
 
Cs 704 d set4distributedcomputing-1funda
Cs 704 d set4distributedcomputing-1fundaCs 704 d set4distributedcomputing-1funda
Cs 704 d set4distributedcomputing-1funda
 

More from Dennis van der Stelt

More from Dennis van der Stelt (10)

Change your architecture during deployment
Change your architecture during deploymentChange your architecture during deployment
Change your architecture during deployment
 
Dealing with eventual consistency
Dealing with eventual consistencyDealing with eventual consistency
Dealing with eventual consistency
 
Dealing with eventual consistency
Dealing with eventual consistencyDealing with eventual consistency
Dealing with eventual consistency
 
Duplicating data or replicating data in Micro Services
Duplicating data or replicating data in Micro ServicesDuplicating data or replicating data in Micro Services
Duplicating data or replicating data in Micro Services
 
Silverlight & WCF RIA
Silverlight & WCF RIASilverlight & WCF RIA
Silverlight & WCF RIA
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
AppFabric Velocity
AppFabric VelocityAppFabric Velocity
AppFabric Velocity
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
App fabric introduction
App fabric introductionApp fabric introduction
App fabric introduction
 
SOLID Principles part 1
SOLID Principles part 1SOLID Principles part 1
SOLID Principles part 1
 

Recently uploaded

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Recently uploaded (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 

Distributed Systems Principles

  • 1. Dennis van der Stelt of distributed systems Dennis van der Stelt http://dennis.bloggingabout.net/ dennis@bloggingabout.net Software Engineer at Particular Software PRINCIPLES
  • 2. Dennis van der Stelt AGENDA
  • 4. Dennis van der Stelt “A distributed system is a software system in which components located on networked computers communicate and coordinate their actions by passing messages.” what is a distributed system Wikipedia
  • 5. Dennis van der Stelt Working distributed…
  • 6. Dennis van der Stelt How hard can it be?
  • 7. Dennis van der Stelt FALLACIES OF DISTRIBUTED COMPUTING PeterDeutsch& othersat Sun Microsystems, 1994 Latency is zero02 Topology doesn’t change05 There is one administrator06 The network is reliable01 Bandwidth is infinite03 Transport cost is zero07 The network is secure04 The network is homogeneous08
  • 8. Dennis van der Stelt Free eBook: Dr. Harvey and the 8 Fallacies of Distributed Computing
  • 9. Dennis van der Stelt The network is reliable
  • 10. Dennis van der Stelt STORE AND FORWARD WITH MSMQ Store locally and pass ontotheinfrastructure SQL Server
  • 11. Dennis van der Stelt using (var scope = new TransactionScope())) { var queue = new MessageQueue(@".Private$Customers"); var message = queue.Receive(); var con = new SqlConnection(); var cmd = new SqlCommand("update customers ..."); cmd.ExecuteNonQuery(); } DISTRIBUTED TRANSACTIONS Microsoft DistributedTransactionCoordinator(MSDTC) Code
  • 12. Dennis van der Stelt using (var scope = new TransactionScope())) { var queue = new MessageQueue(@".Private$Customers"); var message = queue.Receive(); var con = new SqlConnection(); var cmd = new SqlCommand("update customers ..."); cmd.ExecuteNonQuery(); } DISTRIBUTED TRANSACTIONS Microsoft DistributedTransactionCoordinator(MSDTC) Code MSDTC
  • 13. Dennis van der Stelt
  • 14. Dennis van der Stelt Distributed Transactions
  • 15. Dennis van der Stelt DISTRIBUTED TRANSACTIONS The source of a lot of pain RM RM RM RM RM RM RM “Serializable is the highest isolation level. It makes sure that data that anything you have a lock on, is locked for reading by others.” Peter Bailis
  • 16. Dennis van der Stelt STORE AND FORWARD WITH MSMQ Store locally and pass ontotheinfrastructure SQL Server
  • 17. Dennis van der Stelt Handle(CreateClaimCommand msg) { dbContext.Claims.Add(Mapper.Map<Claim>(msg)); dbContext.SaveChanges(); Bus.Publish(new ClaimCreatedEvent()); } DISTRIBUTED TRANSACTIONS WITH NSERVICEBUS Microsoft DistributedTransactionCoordinator(MSDTC) Code Sends email to customer
  • 18. Dennis van der Stelt
  • 19. Dennis van der Stelt NOSQL
  • 20. Dennis van der Stelt CAP Theorem Eric Brewer, PODC Conference 2000
  • 21. Dennis van der Stelt CAP THEOREM You can only pick 2
  • 22. Dennis van der Stelt CAP THEOREM You can only pick 2 centralized system partition tolerantconsistencyavailability
  • 23. Dennis van der Stelt CAP THEOREM You can only pick 2 centralized system partition tolerantconsistencyavailability
  • 24. Dennis van der Stelt CAP THEOREM You can only pick 2 centralized system partition tolerantconsistencyavailability distributed system partition tolerantconsistencyavailability
  • 25. Dennis van der Stelt CAP THEOREM You can only pick 2 centralized system partition tolerantconsistencyavailability distributed system partition tolerantconsistencyavailability when there’s network partition, which do you sacrifice?
  • 26. Dennis van der Stelt Match the business perspective
  • 27. Dennis van der Stelt
  • 28. Dennis van der Stelt
  • 29. Dennis van der Stelt
  • 30. Dennis van der Stelt
  • 31. Dennis van der Stelt But I can’t drop consistency!
  • 32. Dennis van der Stelt Basically Available BASE What is BASE? Soft state Eventually consistent
  • 33. Dennis van der Stelt Eventual Consistency Because 100% consistency isn’t the only option
  • 34. Dennis van der Stelt
  • 35. Dennis van der Stelt Eventual Consistency
  • 36. Dennis van der Stelt Eventual Consistency
  • 37. Dennis van der Stelt Eventual Consistency your “enterprise” is already eventual consistent with reality
  • 38. Dennis van der Stelt Eventual Consistency your “enterprise” is already eventual consistent with reality
  • 39. Dennis van der Stelt “Allow things to be inconsistent and find ways to compensate for mistakes, versus trying to prevent mistakes altogether.” EVENTUAL CONSISTENCY Eric Brewer VP of Infrastructure at Google, Professor at UC Berkeley
  • 40. Dennis van der Stelt 100% synchronized that‘s eventual consistency. Udi Dahanin 2010
  • 41. Dennis van der Stelt45 Idempotence Once and only once delivery is hard!
  • 42. Dennis van der Stelt
  • 43. Dennis van der Stelt IDEMPOTENCE Solving the distributedtransactionissues Sender {0C836F44-6587-416E-B97A-5615615600D5}
  • 44. Dennis van der Stelt IDEMPOTENCE Solving the distributedtransactionissues Sender {0C836F44-6587-416E-B97A-5615615600D5}
  • 45. Dennis van der Stelt IDEMPOTENCE Solving the distributedtransactionissues Sender Event Subscriber {5EDC4993-AB01-4F17-A238-71C4521F750F} {0C836F44-6587-416E-B97A-5615615600D5}
  • 46. Dennis van der Stelt IDEMPOTENCE Solving the distributedtransactionissues Sender Event Subscriber {5EDC4993-AB01-4F17-A238-71C4521F750F} {0C836F44-6587-416E-B97A-5615615600D5}
  • 47. Dennis van der Stelt Distributed Systems Principles  8 Fallacies of distributed computing  (Distributed) Transactions  CAP Theorem & Eventual consistency  Idempotence & outbox pattern
  • 48. Dennis van der Stelt Free eBook: Dr. Harvey and the 8 Fallacies of Distributed Computing http://go.particular.net/ndclondon16
  • 49. Dennis van der Stelt find me. http://dennis.bloggingabout.net dvdstelt@outlook.com