Architectures - Distributed Systems | IT332Software Architecture Processes communicate through a...
Transcript of Architectures - Distributed Systems | IT332Software Architecture Processes communicate through a...
Architectures Distributed Systems IT332
Outline
Architectural Styles:
a particular patterns that focus on the large-scale of a system.
How components are organized, how data is manipulated, how components communicate, ...?
System Architectures
2
Architecture
Software architecture: logical organization of software components and different patterns of communication between them (called connectors), we can come to several styles identified for distributed systems :
Layered architecture
Object‐based architecture
Event‐based architecture
Shared data space architecture
Data-centered architecture
3
Architecture
System architecture: division of responsibilities between software components and the placement of the components on computers.
Centralized Architectures: Client‐server architecture
Decentralized Architectures: Peer‐to‐peer architecture
Hybrid architecture
4
Software Architecture
Layered architecture
Each layer uses the services provided by the layer below to implement new services provided to the layer above.
Example: networking software
5
Software Architecture
An object consists of a set of data and a set of methods.
Objects interact via remote method invocation
Examples: CORBA, DCOM, .Net remoting, Java RMI
The layered and object based architectures still form the most important styles for large software systems
6
Object- based architecture
Software Architecture
7
Event‐Based Architecture
Software Architecture
Components communicate through the propagation of events Publish/subscribe paradigm: components can publish events and subscribe to events
Events are delivered to subscriber once published by publisher
Processes publish events after which the middleware ensures that only subscribed processes will receive them.
Decoupled in space: communicating components need not explicitly refer to each other
Coupled in time: communicating components must execute at the same time
Examples: Multicasting and broadcasting, where user sends a message to multiple receivers without specifying exactly one receiver ( BlackBerry Messenger BBM).
8
Event‐Based Architecture
Software Architecture
9
Data- Centered Architecture
Software Architecture
Processes communicate through a common repository
Publishers post data items to shared data space; subscribers read data items of interest
Processes are decoupled in space and decoupled in time Communicating components need not execute at the same time
The goal is achieving the quality of integrability of data.
3 protocols are needed : communication, data definition and data manipulation protocols
Examples: a wealth of networked applications/ Web-based distributed systems
10
Data- Centered Architecture
Software Architecture
Event-based architectures can be combined with data-centered architectures Shared data spaces.
Processes are now also decoupled in time: they need not both be active when communication takes place.
Ex: Twitter
11
Shared Data- Architecture
System Architecture
12
Basic Client-Server model
System Architecture
Based on client-server interaction/request-reply behavior.
Server: a process that implements a service (exp: file system service, database service).
Client: a process that requests a service from a server
Communication between a client and a server can be implemented by means:
Simple connectionless protocol
Connection oriented protocol.
13
Client‐Server Architecture
System Architecture
Connectionless protocol:
Efficient
the client cannot detect whether the original request message was lost, or that transmission of the reply failed.
Connection oriented protocol:
not entirely appropriate in a local-area network due to relatively low performance
Perfectly tine in wide-area systems.
Exp: TCP/IP connections
Relatively costly, especially when request/reply messages are smaIl.
14
Client‐Server Architecture
System Architecture
Many client‐server applications are organized into three layers:
User‐interface level: contains application’s user interface (character-based screen or graphical window)
Processing level: contains the core functionality of the application.
Data level: contains the data (database or file system) that a client wants to manipulate through the application. It is responsible for keeping data consistent across different applications (exp: bank case)
Examples: a decision support financial system for a stock brokerage, a typical desktop package (‘Office’ suites), Internet search engine.
15
Application Layering
System Architecture
16
Simple user interface: typing a string of keywords presented with a list of titles of Web pages.
The information retrieval part is typically placed at the processing level:
A program that transforms the user's keywords into one or more database queries.
It ranks the results into a list, and transforms that list into a series of HTML pages.
The back end is formed by a huge database of Web pages that have been prefetched and indexed.
Search Engine Example
System Architecture
17
Search Engine Example
System Architecture
Physically distribute a client‐server application across two types
of machines: A client machine containing only the programs implementing (part of) the
user-interface level.
A server machine containing the rest, that is the programs implementing
the processing and data level.
Everything is handled by the server while the client is essentially
no more than a dumb terminal.
18
Physically Two-Tired architecture
System Architecture
19
Physically Two-Tired architecture
Alternative client-server organizations
Distributes the traditional server functionality over multiple servers (vertical distribution)
Each server becomes a client of the next server.
Example 1: in Website, web server acts as an entry point to a site, passing requests to an application server where the actual processing takes place. This application server, in tum, interacts with a database server.
Example2: an application server runs the code to inspect the available inventory of some goods in an electronic bookstore. It interacts with a database containing the raw inventory data.
20
System Architecture
Multitiered client-server
Multi‐Tier Architecture
21
An example of a server acting as client.
Vertical vs. Horizontal Distribution
Vertical distribution is achieved by placing logically different components on different machines. It splits up a server’s functionality over multiple computers
Improves scalability
Horizontal distribution replicates a server’s functionality over multiple computers
Avoids single- point of failure and allows load balancing
Improves scalability and reliability – E.g., replicated web server
22
Peer‐to‐Peer Architecture
A class of modern system architectures that support horizontal distribution. Offers a flexible means for nodes to join and leave the network. All processes provide the same logical services
Each process acts as a client and a server at the same time Examples:P2P file‐sharing
Processes in a P2P system form an overlay network to keep track of all other processes In an overlay network nodes represent processes and links represent communication
channels (e.g., TCP connections) Each node in the overlay network maintains a list of neighbors Processes communicate through the available communication channels
Two types of overlay networks: Unstructured: the overlay network is constructed using a randomized algorithm. Structured: the overlay network is constructed using a deterministic procedure.
23
Unstructured Overlays
The overlay network is constructed based on a randomized algorithm Each node maintains a list of c randomly chosen neighbors (called its partial
view of the network)
Nodes periodically exchange their partial views with their neighbors to create a new partial view
The overlay network tends to stay connected
Data items are randomly placed on nodes To locate a data item, a node floods the network with a search query
Membership management To join the network, a node contacts an arbitrary node from a list of
well‐known access points and copies the partial view of that node.
To leave the network, a node can depart without informing any other node.
24
Chord: A Structured P2P System
Nodes work together to implement a distributed hash table (DHT).
Nodes are logically organized in a ring.
Each data item/node is assigned a random key/identifier from a large identifier space.
Data item with key k is mapped to the node with smallest identifier id ≥ k, denoted as succ(k).
To look up an data item, the system provides an operation LOOKUP(k) that will return the network address of succ(k).
25
The mapping of data items onto nodes in Chord.
Chord (Continued)
When a node wants to join the system
Generate a random identifier id
Do a lookup on id to get the network address of succ(id)
Contact succ(id) and its predecessor, insert itself in the ring
Data items for which node id is now responsible are transferred from succ(id)
When node id wants to leave the system
Inform its predecessor and successor
Transfer its data items to succ(id)
26
Chord (Continued)
Addressed problems
Load balance: distributed hash function, spreading keys evenly over nodes .
Decentralization: chord is fully distributed, no node more important than other, improves robustness ™
Scalability: logarithmic growth of lookup costs with number of nodes in network, even very large systems are feasible.
Availability: chord automatically adjusts its internal tables to ensure that the node responsible for a key can always be found.
27
Hybrid Architectures
Combines client‐server architecture and P2P architecture
Examples:
Superpeer networks
Collaborative distributed systems
Edge‐server systems
28
Superpeer Networks
A few superpeers form a P2P network, regular peers are clients of superpeers
Locating data items can be made more efficient by using superpeers
A superpeer maintains an index of its clients’ data items
Clients submit queries to their superpeers
A superpeer should be long‐lived, have high bandwidth, storage, and processing capacity.
A new problem is related to the leader/superpeer election problem.
Examples: Kazaa, Skype
29
Collaborative Distributed Systems
A hybrid distributed model that is based on mutual collaboration of various systems
Examples of Collaborative Distributed System: ƒ
BitTorrent: is a P2P File downloading system. It allows download of various chunks of a file from other users until the entire file is downloaded ƒ
Globule: A Collaborative content distribution network. It allows replication of web pages by various web servers
30
BitTorrent
BitTorrent enables fast downloading of large files through P2P file downloads
A node downloads chunks of a file from many other nodes
Client‐server architecture is used for the initial setup of the network
Tracker keeps track of which active nodes have which chunks of a file
There is one tracker per file
Enforce collaboration by penalizing selfish nodes
If P sees Q downloads more than uploads, reduce rate of sending to Q
31
BitTorrent
32
1 tracker/ file, tracker holds which node holds which chunk of the file
Information needed to download a specific file
Globule
Components of Globule collaborative content distribution network: (replication of web pages by various users). A component that can redirect client requests to other servers.
A component for analyzing access patterns.
A component for managing the replication of Web pages.
A centralized component in the form of its broker responsible for registering servers, and making these servers known to others.
Benefits: Good if your server goes down.
Good if too much traffic that your server can not handle or server gets too slow.
Better Geographic diversity.
End users voluntarily provide enhanced web servers that are capable of collaborating in the replication of web pages.
33
Edge‐Server Systems
34
Edge‐Server Systems
Deployed on the Internet where servers are “at the edge” of the network (i.e. first entry to network)
Each client connects to the Internet by means of an edge server. ™ This edge is formed by the boundary between enterprise networks and the actual Internet.
Example, as provided by an Internet Service Provider (ISP).
The edge server's main purpose is to serve content as an origin server, after applying filtering and transcoding functions. This server can use other edge servers for replicating Web pages.
a collection of edge servers can be used to optimize content and application distribution.
35
Next Chapter
Process
Questions?!
36