Logic
Logic
Introduction
Building a Distributed System
Smruti R. Sarangi
Outline
1 Plan
2 Introduction
Overview
Developing Distributed Systems: Pitfalls
Lectures - I
Lecture Topic
1 Introduction and Structure
2 Communication – Client Server, RPC
Message Queue, Stream
3 Multicast Communication – Epidemic, Gossip
4 Naming : DNS, Chord
5 Naming : Pastry, Tapestry, LDAP
6 Physical Clock , Logical Clock, Totally ordered multicast
7 Mutual Exclusion Algorithms
8 Leader Election Algorithms
9 Consistency - I
10 Consistency - II
11 Fault Tolerance – Introduction, Log based recovery
12 Byzantine Fault Tolerance
Lectures - II
Lecture Topic
13 Paxos
14 Distributed Commit
15 Security – Channels, Concepts
16 Security Applications – Kerberos
Diffie Helmann Key Exchange
17 Corba, EJB
18 AFS and NFS
19 Akamai and Corona
20 Dynamo and Voldemort
21 Coda, Fawn, and Google FS
22 Web Services
23 Dryad-LinQ
Grading Scheme
Component Weightage
Attendance 15%
Midterm 15%
End term (take home) 20%
Programming Assignment 1 15%
Programming Assignment 2 15%
Programming Assignment 3 20%
Outline
1 Plan
2 Introduction
Overview
Developing Distributed Systems: Pitfalls
Two aspects:
1 independent computers
2 single coherent system ⇒ middleware .
Goals
Making resources available
Distribution transparency
Openness
Scalability
Distribution Transparency
Transp.
Description
Access Hides differences in data representation and invocation
mechanisms
Location Hides where an object resides
Migration Hides from an object the ability of a system to change that
object’s location
Relocation Hides from a client the ability of a system to change the
location of an object to which the client is bound
Replication Hides the fact that an object or its state may be replicated
and that replicas reside at different locations
Concurrency Hides the coordination of activities between objects to
achieve consistency at a higher level
Failure Hides failure and possible recovery of objects
Distribution Transparency
Transp.
Description
Access Hides differences in data representation and invocation
mechanisms
Location Hides where an object resides
Migration Hides from an object the ability of a system to change that
object’s location
Relocation Hides from a client the ability of a system to change the
location of an object to which the client is bound
Replication Hides the fact that an object or its state may be replicated
and that replicas reside at different locations
Concurrency Hides the coordination of activities between objects to
achieve consistency at a higher level
Failure Hides failure and possible recovery of objects
Note
Distribution transparency is a nice a goal, but achieving it is a different story.
Degree of Transparency
Degree of Transparency
Degree of Transparency
Degree of Transparency
Observation
Many developers of modern distributed system easily use the adjective
“scalable” without making clear why their system actually scales.
Observation
Many developers of modern distributed system easily use the adjective
“scalable” without making clear why their system actually scales.
Observation
Many developers of modern distributed system easily use the adjective
“scalable” without making clear why their system actually scales.
Observation
Most systems account only, to a certain extent, for size scalability. The
(non)solution: powerful servers. Today, the challenge lies in geograph-
ical and administrative scalability.
Distribution
Partition data and computations across multiple machines:
Move computations to clients (Java applets)
Decentralized naming services (DNS)
Decentralized information systems (WWW)
Replication/caching
Make copies of data available at different machines:
Replicated file servers and databases
Mirrored Web sites
Web caches (in browsers and proxies)
File caching (at server and client)
Observation
If we can tolerate inconsistencies, we may reduce the need for
global synchronization, but tolerating inconsistencies is applica-
tion dependent .
Smruti R. Sarangi Advanced Distributed Systems
Plan
Overview
Introduction
Developing Distributed Systems: Pitfalls
Building a Distributed System
Outline
1 Plan
2 Introduction
Overview
Developing Distributed Systems: Pitfalls
Centralized Layered
Definition
Synchronous System The requester waits for the response be-
fore placing other requests.
Definition
Asynchronous System The requester does not wait for the re-
sponse before placing other requests. One example of such
systems are publish/subscribe systems. A given set of nodes
subscribe for a service. When a node is ready to publish some
data, it looks up the list of subscribers and sends them mes-
sages.
Outline
1 Plan
2 Introduction
Overview
Developing Distributed Systems: Pitfalls
Computing Nodes
A compute node can either be a process or a thread
Thread
A thread is a light weight process that shares the address space
with other threads.
Process
A process is the runtime image of a program. It does not share
its address space.
Computing Nodes - II
Outline
1 Plan
2 Introduction
Overview
Developing Distributed Systems: Pitfalls
Middleware Layer
Observation
Middleware is invented to provide common services and proto-
cols that can be used by many different applications
Note
What remains are truly application-specific protocols...
such as?
Smruti R. Sarangi Advanced Distributed Systems
Computation
Plan
Communication
Introduction
Remote Procedure Calls
Building a Distributed System
Message-Oriented Communication
Outline
1 Plan
2 Introduction
Overview
Developing Distributed Systems: Pitfalls
Request Reply
Server
Call local procedure Time
and return results
Conclusion
Communication between caller & callee can be hidden by using
procedure-call mechanism.
3. Message is sent
across the network
Conclusion
Full access transparency cannot be realized.
Asynchronous RPCs
Essence
Try to get rid of the strict request-reply behavior, but let the client
continue without waiting for an answer from the server.
Server Call local procedure Time Server Call local procedure Time
and return results
(a) (b)
Variation
Client can also do a (non)blocking poll at the server to see
whether results are available.
RPC in practice
Uuidgen
Interface
definition file
IDL compiler
#include #include
Runtime Runtime
Linker Linker
library library
Client Server
binary binary
Issues
(1) Client must locate server machine, and (2) locate the server.
Directory machine
Directory
server
2. Register service
3. Look up server
Server machine
Client machine
Outline
1 Plan
2 Introduction
Overview
Developing Distributed Systems: Pitfalls
Message-Oriented Communication
Transient Messaging
Message-Queuing System
Message Brokers
Example: IBM WebSphere
Server
socket bind listen accept read write close
Message-oriented middleware
Essence
Asynchronous persistent communication through support of
middleware-level queues. Queues correspond to buffers at com-
munication servers.
Message broker
Observation
Message queuing systems assume a common messaging pro-
tocol : all applications agree on message format (i.e., structure
and data representation)
Message broker
Repository with
conversion rules
Source client Message broker and programs Destination client
Broker
program
Queuing
layer
OS OS OS
Network
IBM’s WebSphere MQ
IBM’s WebSphere MQ
Message Transfer
Messages are transferred between queues
Message transfer between queues at different processes,
requires a channel
At each endpoint of channel is a message channel agent
Message channel agents are responsible for:
Setting up channels using lower-level network communica-
tion facilities (e.g., TCP/IP)
(Un)wrapping messages from/in transport-level packets
Sending/receiving packets
IBM’s WebSphere MQ
Client's receive
Routing table Send queue queue Receiving client
Sending client
Queue Queue
Program manager manager Program
MQ Interface
Server Server
Stub MCA MCA MCA MCA Stub
stub stub
IBM’s WebSphere MQ
Routing
By using logical names, in combination with name resolution to local
queues, it is possible to put a message in a remote queue