introduction to distributed systems
DESCRIPTION
Introduction to Distributed Systems. Chapter two Architectures . Introduction . Distributed systems are often complex pieces of software of which the components are by definition dispersed across multiple machines . - PowerPoint PPT PresentationTRANSCRIPT
Com
pile
d by
: Mira
f Bel
yuIntroduction to Distributed SystemsChapter twoArchitectures
Com
pile
d by
: Mira
f Bel
yu
Introduction
Distributed systems are often complex pieces of software of which the components are by definition dispersed across multiple machines.
Organization of distributed systems is mostly about the software components that constitute the system.
Com
pile
d by
: Mira
f Bel
yu
Introduction cont…
Organization • Logical organization• Physical organization
Com
pile
d by
: Mira
f Bel
yu
Introduction cont…
Software architecture• how the various software components are
to be organized and how they should interact.
system architecture• instantiate and place software components
on real machines.
Com
pile
d by
: Mira
f Bel
yu
Introduction cont…
Centralized architecture •Single server implements software components•Remote clients access the server with any communication means
Com
pile
d by
: Mira
f Bel
yu
Sample centralized architecture
Com
pile
d by
: Mira
f Bel
yu
Centralized architecture cont…
Drawback •Not easily scalable• Limitation in the number of CPUs.• Entire system needs to be upgraded or
replaced
Com
pile
d by
: Mira
f Bel
yu
Introduction cont…
Decentralized architecture •Two or more machines•Plays more or less equal role
Com
pile
d by
: Mira
f Bel
yu
Architectural styles
Formulated in terms of componentsThe way that components are connected
to each otherThe data exchanged between componentsHow these elements are jointly configured
into a system
Com
pile
d by
: Mira
f Bel
yu
Architectural styles cont…
Layered architecture Object – based architectureData – centered architectureEvent – based architecture
Com
pile
d by
: Mira
f Bel
yu
Layered architecture
Components are organized in a layered fashion
Component at layer L; is allowed to call components at the underlying layer Li
But not vise versa
Com
pile
d by
: Mira
f Bel
yu
Layered architecture cont…
Com
pile
d by
: Mira
f Bel
yu
Layered architecture cont…
Key observation is that control generally flows from layer to layer
Requests go down the hierarchy whereas the results flow upward
Com
pile
d by
: Mira
f Bel
yu
Object – based architecture
Each object corresponds to what is called a component
Components are connected through a (remote) procedure call mechanism
Matches the client-server system architecture.
Com
pile
d by
: Mira
f Bel
yu
Sample object – based arch
Com
pile
d by
: Mira
f Bel
yu
Data – centric architecture
Processes communicate through a common repository.
Processes communicate through shared data
Com
pile
d by
: Mira
f Bel
yu
Data – centric architecture cont…
Shared distributed file system in which virtually all communication takes place through files
Web-based distributed systems, are largely data-centric
Com
pile
d by
: Mira
f Bel
yu
Event – based architectures
Processes essentially communicate through the propagation of events, which optionally also carry data.
Associated with what are known as publish/subscribe systems.
Com
pile
d by
: Mira
f Bel
yu
Event – based architectures cont…
Processes publish events after middleware ensures that only those processes that subscribed to those events will receive them
Advantage :•Processes are Decoupled in space,
or referentially decoupled.
Com
pile
d by
: Mira
f Bel
yu
Advantage cont…
Referentially decoupled implies processes need not explicitly refer to each other
Com
pile
d by
: Mira
f Bel
yu
System architectures
Com
pile
d by
: Mira
f Bel
yuWhat is System Architecture?
Com
pile
d by
: Mira
f Bel
yu
System Architecture
CentralizedDecentralized Hybrid
Com
pile
d by
: Mira
f Bel
yu
Centralized Architecture
Basic client-server modelA server is a process (machine) implementing a specific service
for example, a file system service or a database service.
Com
pile
d by
: Mira
f Bel
yu
Centralized Architecture cont…
A client is a process that requests a service from a server by sending it a request and subsequently waiting for the server's reply.
client-server interaction is also known as request-reply.
Com
pile
d by
: Mira
f Bel
yu
Centralized Architecture cont…
Com
pile
d by
: Mira
f Bel
yu
Centralized Architecture cont…
The communication can be either of the following:•Connection less protocol•Connection - oriented protocol
Com
pile
d by
: Mira
f Bel
yu
Centralized Architecture cont…
Connectionless protocolIf the underlying network is fairly reliable as in many local-area networks
Com
pile
d by
: Mira
f Bel
yu
How Connectionless protocol works
How client requests a service:•Packages a message for the server• Identifying the service it wants• Include necessary input data•The message is then sent to the server.
Com
pile
d by
: Mira
f Bel
yu
Cont…
How servers works:•Always wait for an incoming request•Subsequently process requests•Package the results in a reply message•Send replies to the client
Com
pile
d by
: Mira
f Bel
yu
Centralized Architecture cont…
Connection - oriented protocolIs not entirely appropriate in a local-area network due to relatively low performance
Works perfectly fine in wide-area systems in which communication is inherently unreliable
Com
pile
d by
: Mira
f Bel
yu
Cont…
For example, All Internet application protocols are based on reliable TCP/IP connections.
Com
pile
d by
: Mira
f Bel
yu
How connection – oriented protocol works
When client requests a service:•Sets up a connection to the server before sending the request•Server generally uses that same connection to send the reply message
Com
pile
d by
: Mira
f Bel
yu
Cons of connection – oriented protocol
Setting up and tearing down a connection is relatively costly, especially when the request and reply messages are small.
Com
pile
d by
: Mira
f Bel
yu
Centralized Architecture cont…Application Layering•The user-interface level•A part that handles interaction with a user•The processing level•A part that operates on a database or file
system•The data level•A middle part that generally contains the
core functionality of an application
Com
pile
d by
: Mira
f Bel
yu
Cont.… Search Engine Example
Com
pile
d by
: Mira
f Bel
yu
Decentralized Architecture
Vertical distribution• Is achieved by placing different
components on different machines• functions are logically and physically
split across multiple machines• each machine is tailored to a specific
group of functions
Com
pile
d by
: Mira
f Bel
yu
Decentralized Architecture
Horizontal distribution•Client or server may be physically split up into logically equivalent parts, but•Each part is operating on its own share of the complete data set•Balance the load
Com
pile
d by
: Mira
f Bel
yu
Structured peer – to – peer Arch
Network is constructed using a deterministic procedure like Distributed Hash Table (DHT)
Com
pile
d by
: Mira
f Bel
yu
Structured peer to peer cont …
Distributed Hash Table (DHT)• Data items are assigned a random key
(128-bit or 160-bit identifier)• Nodes assigned a random number from
the same identifier space• DHT Maps the key of a data item to the
identifier of a node based on some distance metric
Com
pile
d by
: Mira
f Bel
yu
Unstructured peer –to – peer Arch
Rely on randomized algorithms for constructing an overlay network
Each node maintains a list of neighbors
Data items are randomly placed on nodes
Com
pile
d by
: Mira
f Bel
yu
Cont..
When a node needs to locate a specific data item, it floods the network with a search query.
Alternative way:•Super-peers
Com
pile
d by
: Mira
f Bel
yu
Super - peers
Make use of special nodes that maintain an index of data items
Com
pile
d by
: Mira
f Bel
yu
Super – peer cont
Problem •select the nodes that are eligible to become super peer•Leader-election problem
Com
pile
d by
: Mira
f Bel
yu
Hybrid Architecture
Com
pile
d by
: Mira
f Bel
yu
Hybrid Architecture
Client-server solutions are combined with decentralized architectures
•Edge-Server Systems•Collaborative Distributed Systems
Com
pile
d by
: Mira
f Bel
yu
Edge – Server Systems
Deployed on the InternetServers are placed "at the edge" of the network
Boundary between enterprise networks and the actual Internet
Com
pile
d by
: Mira
f Bel
yu
Edge – Server Systems
Com
pile
d by
: Mira
f Bel
yu
Collaborative Distributed Systems
Once a node has joined the system, it can use a fully decentralized scheme for collaboration.
BitTorrent
Com
pile
d by
: Mira
f Bel
yu
BitTorrent implementation
Com
pile
d by
: Mira
f Bel
yu
System Models
Com
pile
d by
: Mira
f Bel
yu
System Models
Provide an abstract, simplified but consistent description of a relevant aspect of distributed system design.
Com
pile
d by
: Mira
f Bel
yu
System models cont…
Physical modelsArchitectural modelsFundamental models
Com
pile
d by
: Mira
f Bel
yu
Physical models
Hardware composition of a system in terms of:
ComputersMobilesAnd their interconnecting
network
Com
pile
d by
: Mira
f Bel
yu
Physical models cont…
Three generations of distributed systems:
1. Early Distributed Systems2. Internet – Scale Distributed Systems3. Contemporary Distributed Systems
Com
pile
d by
: Mira
f Bel
yu
Generation of Distributed Sys.
Early Distributed Systemslate 1970s and early 1980s in response
to the emergence of local area networking technology, usually Ethernet
10 to 100 nodes interconnected by a LANSmall rage of services like:
Local printer sharing and file servers
Com
pile
d by
: Mira
f Bel
yu
Early Distributed Systems cont…
Homogenous individual systemsOpenness not implemented largelyQoS didn’t metNodes are typically Desktop PCs:• Static• Autonomous•Discrete
Com
pile
d by
: Mira
f Bel
yu
Generation cont…
Internet – scale distributed systems1990s in response to growth of the Internet
Large number of nodesNodes interconnected by network of networks (Internet)
Com
pile
d by
: Mira
f Bel
yu
Internet – Scale Distributed Systems cont…Highly heterogeneous:
• Network, PC architecture, OS, implementation language and etc.
Nodes are typically Desktop PCs:• Static• Autonomous• Discrete
Google (1996)About 16 or 17 years before
Com
pile
d by
: Mira
f Bel
yu
Generation cont…
Contemporary Distributed SystemsMobile computing (laptops and
smartphones capabilities)Ubiquitous computing (embedded
computers in everyday life)Cloud computing highly not
autonomous
Com
pile
d by
: Mira
f Bel
yu
Fundamental models
Takes an abstract perspective in order to examine individual aspects of a distributed system• Interaction models•Failure models•Security models
Com
pile
d by
: Mira
f Bel
yu
Fundamental models cont…
Interaction modelsConsider the structure and sequencing of the communication between the elements of the system
Com
pile
d by
: Mira
f Bel
yu
Fundamental models cont…
Failure modelsConsider the ways in which a system may fail to operate correctly
Com
pile
d by
: Mira
f Bel
yu
Fundamental models cont…
Security modelsConsider how the system is protected against attempts to interfere with its correct operation or to steal its data
Com
pile
d by
: Mira
f Bel
yu
Architectural models
System structure in terms of separately specified components and their interrelationships
Architectural elementsCommunicating entitiesCommunication paradigms
Com
pile
d by
: Mira
f Bel
yu
Communicating entities
Are the entities that are communicating in the distributed system•Objects• Components•Web services
Com
pile
d by
: Mira
f Bel
yu
Communicating entities cont…
ObjectsEnable and encourage the use of object-oriented approaches in distributed systems (including both object-oriented design and OOP)
Com
pile
d by
: Mira
f Bel
yu
Communicating entities cont…
Components Interconnected to form the systemAccessed through interfacesDependency between components
Com
pile
d by
: Mira
f Bel
yu
Communicating entities cont…
Web servicesClosely related to objects and components
Are intrinsically integrated into the World Wide Web
Com
pile
d by
: Mira
f Bel
yu
Communication paradigms
How entities communicate in a distributed system
Three paradigms:• Inter process communication• Remote invocation • Indirect communication
Com
pile
d by
: Mira
f Bel
yu
Inter process communication
Low-level support for communication between processes
Including message-passing primitives, direct access to the API offered by Internet protocols (socket programming) and support for multicast communication.
Com
pile
d by
: Mira
f Bel
yu
Remote invocation
Based on a two-way exchange between communicating entities in a distributed system and resulting in the calling of a remote operation, procedure or method.
Request-reply protocol• Remote procedure call• Remote method invocation
Com
pile
d by
: Mira
f Bel
yu
Remote procedure call (RPC)
Procedures in processes on remote computers can be called as if they are procedures in the local address space
Com
pile
d by
: Mira
f Bel
yu
Remote Method Invocation (RMI)
A calling object can invoke a method in a remote object
The underlying details are generally hidden from the user