SlideShare a Scribd company logo
1 of 17
Download to read offline
BUILDING A DISTRIBUTED
SYSTEM
PART ONE: THE BASICS
Presented by / April 28th, 2015Rich Beaudoin @RichGBeaudoin  
OVERVIEW
What is a distributed system?
Why distributed systems?
Some Fundamental concepts
Lamport: A Distributed System From Scratch
WHAT IS A DISTRIBUTED
SYSTEM?
A distributed system is a software system in
which components located on networked
computers communicate and coordinate their
actions by passing messages
Source: Distributed Systems: Concepts and Design (5th
Edition). Boston: Addison-Wesley
SOME EXAMPLES
WHY DISTRIBUTED
SYSTEMS?
Fault tolerance, and availability
Horizontal scalability
Decentralization
An opportunity to geek out :)
FUNDAMENTALS: CONSISTENCY MODELS
"More formally, we say that a consistency
model is the set of all allowed histories of
operations. If we run a program and it goes
through a sequence of operations in the
allowed set, that particular execution is
consistent. If the program screws up
occasionally and goes through a history not in
the consistency model, we say the history was
inconsistent. If every possible execution falls
into the allowed set, the system satis es the
model." - Kyle Kingsbury @aphyr
FUNDAMENTALS: CONSISTENCY MODELS
STRICT CONSISTENCY
FUNDAMENTALS: CONSISTENCY MODELS
SEQUENTIAL CONSISTENCY (LINEARIZABILITY, SERIALIZABILITY)
FUNDAMENTALS: CONSISTENCY MODELS
CAUSAL CONSISTENCY
Writes that are "causally related" must be seen by all
processors same order
Includes "potentially" causal relationships
Concurrent writes are allowed to be seen in different order
on different processors
FUNDAMENTALS: CAP THEOREM
We need to be careful about applying CAP incorrectly
FUNDAMENTALS: TIME
Clocks can drift, synchronizing time across nodes is
dif cult
Without time, how can we order events across the system?
Lamport Timestamps (logical clocks)
Vector Clocks
Be sure to check out
by Lesile Lamport
Time, Clocks, and the Ordering of
Events in a Distributed System
FUNDAMENTALS: CONSENSUS
The system will have to be brought to consensus to handle
situations like:
Leader Election
Commiting Transactions
State Machine Replication
To do this we can use protocols and alogorithms like:
Or a tool library like
Raft
Paxos
Zookeeper...
INTRODUCTION TO APACHE ZOOKEEPER
Distributed system for building distributed systems!
Provides a hierarchichal namespace of values (i.e. znodes)
Clients can create/delete znodes
Znodes can be ephemeral and/or sequenced
Clients can "watch" for znode changes
INTRODUCING LAMPORT
A distributed system built in Go
An academic exercise to learn about distributed systems
Initially using Zookeeper "recipes" for leader election
An opportunity to verify correctness of consistency models
Lamport on Github
Lamport Google Group
QUESTIONS??
REFERENCES
Distributed Systems: Concepts and Design, 5th Edition
Strong Consistency Models- Kyle Kingsbury (@aphyr)
Designing Large-Scale Distributed Systems - Ashwani
Priyedarshi
CS865 – Distributed Software DevelopmentLecture 7 -
Pace University
CAP Theorem - Brewer, Gilbert, Lynch
Time, Clocks, and the Ordering of Events in a Distributed
System
REFERENCES (CONTINUED)
In Search of an Understandable Consensus Algorithm
(Raft)
Paxos Made Simple
Apache Zookeeper

More Related Content

Similar to Building a Distributed System, The Basics

Event-driven Infrastructure - Mike Place, SaltStack - DevOpsDays Tel Aviv 2016
Event-driven Infrastructure - Mike Place, SaltStack - DevOpsDays Tel Aviv 2016Event-driven Infrastructure - Mike Place, SaltStack - DevOpsDays Tel Aviv 2016
Event-driven Infrastructure - Mike Place, SaltStack - DevOpsDays Tel Aviv 2016DevOpsDays Tel Aviv
 
ScalaItaly 2015 - Your Microservice as a Function
ScalaItaly 2015 - Your Microservice as a FunctionScalaItaly 2015 - Your Microservice as a Function
ScalaItaly 2015 - Your Microservice as a FunctionPhil Calçado
 
Phil Calçado - Your microservice as a function
Phil Calçado - Your microservice as a functionPhil Calçado - Your microservice as a function
Phil Calçado - Your microservice as a functionScala Italy
 
Linux Assignment 3
Linux Assignment 3Linux Assignment 3
Linux Assignment 3Diane Allen
 
Unit 5- Architectural Design in software engineering
Unit 5- Architectural Design in software engineering Unit 5- Architectural Design in software engineering
Unit 5- Architectural Design in software engineering arvind pandey
 
Bt0070 operating systems 1
Bt0070 operating systems  1Bt0070 operating systems  1
Bt0070 operating systems 1Techglyphs
 
Bt0081 software engineering2
Bt0081 software engineering2Bt0081 software engineering2
Bt0081 software engineering2Techglyphs
 
07 software design
07   software design07   software design
07 software designkebsterz
 
07 software design
07   software design07   software design
07 software designkebsterz
 
Software Architectures, Week 2 - Decomposition techniques
Software Architectures, Week 2 - Decomposition techniquesSoftware Architectures, Week 2 - Decomposition techniques
Software Architectures, Week 2 - Decomposition techniquesAngelos Kapsimanis
 
From Model-based to Model and Simulation-based Systems Architectures
From Model-based to Model and Simulation-based Systems ArchitecturesFrom Model-based to Model and Simulation-based Systems Architectures
From Model-based to Model and Simulation-based Systems ArchitecturesObeo
 
Distributed systems_important 2marks.docx
Distributed systems_important 2marks.docxDistributed systems_important 2marks.docx
Distributed systems_important 2marks.docx20TUCS251VIJAYASHARA
 
KEY CONCEPTS FOR SCALABLE STATEFUL SERVICES
KEY CONCEPTS FOR SCALABLE STATEFUL SERVICESKEY CONCEPTS FOR SCALABLE STATEFUL SERVICES
KEY CONCEPTS FOR SCALABLE STATEFUL SERVICESMykola Novik
 
Moving to Microservices with the Help of Distributed Traces
Moving to Microservices with the Help of Distributed TracesMoving to Microservices with the Help of Distributed Traces
Moving to Microservices with the Help of Distributed TracesKP Kaiser
 
Chapter Introductionn to distributed system .pptx
Chapter Introductionn to distributed system .pptxChapter Introductionn to distributed system .pptx
Chapter Introductionn to distributed system .pptxTekle12
 
Ooad Overview
Ooad OverviewOoad Overview
Ooad OverviewDang Tuan
 

Similar to Building a Distributed System, The Basics (20)

Event-driven Infrastructure - Mike Place, SaltStack - DevOpsDays Tel Aviv 2016
Event-driven Infrastructure - Mike Place, SaltStack - DevOpsDays Tel Aviv 2016Event-driven Infrastructure - Mike Place, SaltStack - DevOpsDays Tel Aviv 2016
Event-driven Infrastructure - Mike Place, SaltStack - DevOpsDays Tel Aviv 2016
 
ScalaItaly 2015 - Your Microservice as a Function
ScalaItaly 2015 - Your Microservice as a FunctionScalaItaly 2015 - Your Microservice as a Function
ScalaItaly 2015 - Your Microservice as a Function
 
Phil Calçado - Your microservice as a function
Phil Calçado - Your microservice as a functionPhil Calçado - Your microservice as a function
Phil Calçado - Your microservice as a function
 
Linux Assignment 3
Linux Assignment 3Linux Assignment 3
Linux Assignment 3
 
Unit 5- Architectural Design in software engineering
Unit 5- Architectural Design in software engineering Unit 5- Architectural Design in software engineering
Unit 5- Architectural Design in software engineering
 
Bt0070 operating systems 1
Bt0070 operating systems  1Bt0070 operating systems  1
Bt0070 operating systems 1
 
Bt0081 software engineering2
Bt0081 software engineering2Bt0081 software engineering2
Bt0081 software engineering2
 
Dsys guide37
Dsys guide37Dsys guide37
Dsys guide37
 
07 software design
07   software design07   software design
07 software design
 
07 software design
07   software design07   software design
07 software design
 
Software Architectures, Week 2 - Decomposition techniques
Software Architectures, Week 2 - Decomposition techniquesSoftware Architectures, Week 2 - Decomposition techniques
Software Architectures, Week 2 - Decomposition techniques
 
From Model-based to Model and Simulation-based Systems Architectures
From Model-based to Model and Simulation-based Systems ArchitecturesFrom Model-based to Model and Simulation-based Systems Architectures
From Model-based to Model and Simulation-based Systems Architectures
 
Dsm presentation (english)
Dsm presentation (english)Dsm presentation (english)
Dsm presentation (english)
 
L1 Intro To Lscits
L1 Intro To LscitsL1 Intro To Lscits
L1 Intro To Lscits
 
Distributed systems_important 2marks.docx
Distributed systems_important 2marks.docxDistributed systems_important 2marks.docx
Distributed systems_important 2marks.docx
 
KEY CONCEPTS FOR SCALABLE STATEFUL SERVICES
KEY CONCEPTS FOR SCALABLE STATEFUL SERVICESKEY CONCEPTS FOR SCALABLE STATEFUL SERVICES
KEY CONCEPTS FOR SCALABLE STATEFUL SERVICES
 
Moving to Microservices with the Help of Distributed Traces
Moving to Microservices with the Help of Distributed TracesMoving to Microservices with the Help of Distributed Traces
Moving to Microservices with the Help of Distributed Traces
 
Chapter Introductionn to distributed system .pptx
Chapter Introductionn to distributed system .pptxChapter Introductionn to distributed system .pptx
Chapter Introductionn to distributed system .pptx
 
Open modeling and simulation framework for evolutive analysis
Open modeling and simulation framework for evolutive analysisOpen modeling and simulation framework for evolutive analysis
Open modeling and simulation framework for evolutive analysis
 
Ooad Overview
Ooad OverviewOoad Overview
Ooad Overview
 

Building a Distributed System, The Basics

  • 1. BUILDING A DISTRIBUTED SYSTEM PART ONE: THE BASICS Presented by / April 28th, 2015Rich Beaudoin @RichGBeaudoin  
  • 2. OVERVIEW What is a distributed system? Why distributed systems? Some Fundamental concepts Lamport: A Distributed System From Scratch
  • 3. WHAT IS A DISTRIBUTED SYSTEM? A distributed system is a software system in which components located on networked computers communicate and coordinate their actions by passing messages Source: Distributed Systems: Concepts and Design (5th Edition). Boston: Addison-Wesley
  • 5. WHY DISTRIBUTED SYSTEMS? Fault tolerance, and availability Horizontal scalability Decentralization An opportunity to geek out :)
  • 6. FUNDAMENTALS: CONSISTENCY MODELS "More formally, we say that a consistency model is the set of all allowed histories of operations. If we run a program and it goes through a sequence of operations in the allowed set, that particular execution is consistent. If the program screws up occasionally and goes through a history not in the consistency model, we say the history was inconsistent. If every possible execution falls into the allowed set, the system satis es the model." - Kyle Kingsbury @aphyr
  • 8. FUNDAMENTALS: CONSISTENCY MODELS SEQUENTIAL CONSISTENCY (LINEARIZABILITY, SERIALIZABILITY)
  • 9. FUNDAMENTALS: CONSISTENCY MODELS CAUSAL CONSISTENCY Writes that are "causally related" must be seen by all processors same order Includes "potentially" causal relationships Concurrent writes are allowed to be seen in different order on different processors
  • 10. FUNDAMENTALS: CAP THEOREM We need to be careful about applying CAP incorrectly
  • 11. FUNDAMENTALS: TIME Clocks can drift, synchronizing time across nodes is dif cult Without time, how can we order events across the system? Lamport Timestamps (logical clocks) Vector Clocks Be sure to check out by Lesile Lamport Time, Clocks, and the Ordering of Events in a Distributed System
  • 12. FUNDAMENTALS: CONSENSUS The system will have to be brought to consensus to handle situations like: Leader Election Commiting Transactions State Machine Replication To do this we can use protocols and alogorithms like: Or a tool library like Raft Paxos Zookeeper...
  • 13. INTRODUCTION TO APACHE ZOOKEEPER Distributed system for building distributed systems! Provides a hierarchichal namespace of values (i.e. znodes) Clients can create/delete znodes Znodes can be ephemeral and/or sequenced Clients can "watch" for znode changes
  • 14. INTRODUCING LAMPORT A distributed system built in Go An academic exercise to learn about distributed systems Initially using Zookeeper "recipes" for leader election An opportunity to verify correctness of consistency models Lamport on Github Lamport Google Group
  • 16. REFERENCES Distributed Systems: Concepts and Design, 5th Edition Strong Consistency Models- Kyle Kingsbury (@aphyr) Designing Large-Scale Distributed Systems - Ashwani Priyedarshi CS865 – Distributed Software DevelopmentLecture 7 - Pace University CAP Theorem - Brewer, Gilbert, Lynch Time, Clocks, and the Ordering of Events in a Distributed System
  • 17. REFERENCES (CONTINUED) In Search of an Understandable Consensus Algorithm (Raft) Paxos Made Simple Apache Zookeeper