911 likes | 1.2k Views
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 .
E N D
Introduction to Distributed Systems Compiled by: Miraf Belyu Chapter two Architectures
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. Compiled by: Miraf Belyu
Introduction cont… • Organization • Logical organization • Physical organization Compiled by: Miraf Belyu
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. Compiled by: Miraf Belyu
Introduction cont… • Centralized architecture • Single server implements software components • Remote clients access the server with any communication means Compiled by: Miraf Belyu
Sample centralized architecture Compiled by: Miraf Belyu
Centralized architecture cont… • Drawback • Not easily scalable • Limitation in the number of CPUs. • Entire system needs to be upgraded or replaced Compiled by: Miraf Belyu
Introduction cont… • Decentralized architecture • Two or more machines • Plays more or less equal role Compiled by: Miraf Belyu
Architectural styles • Formulated in terms of components • The way that components are connected to each other • The data exchanged between components • How these elements are jointly configured into a system Compiled by: Miraf Belyu
Architectural styles cont… • Layered architecture • Object – based architecture • Data – centered architecture • Event – based architecture Compiled by: Miraf Belyu
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 Compiled by: Miraf Belyu
Layered architecture cont… Compiled by: Miraf Belyu
Layered architecture cont… • Key observation is that control generally flows from layer to layer • Requests go down the hierarchy whereas the results flow upward Compiled by: Miraf Belyu
Object – based architecture • Each object corresponds to what is called a component • Components are connected through a (remote) procedure call mechanism • Matchesthe client-server system architecture. Compiled by: Miraf Belyu
Sample object – based arch Compiled by: Miraf Belyu
Data – centric architecture • Processes communicate through a common repository. • Processes communicate through shared data Compiled by: Miraf Belyu
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 Compiled by: Miraf Belyu
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. Compiled by: Miraf Belyu
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. Compiled by: Miraf Belyu
Advantage cont… • Referentially decoupled implies processes need not explicitly refer to each other Compiled by: Miraf Belyu
System architectures Compiled by: Miraf Belyu
What is System Architecture? Compiled by: Miraf Belyu
System Architecture • Centralized • Decentralized • Hybrid Compiled by: Miraf Belyu
Centralized Architecture • Basic client-servermodel • A server is a process (machine) implementing a specific service for example, a file system service or a database service. Compiled by: Miraf Belyu
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. Compiled by: Miraf Belyu
Centralized Architecture cont… Compiled by: Miraf Belyu
Centralized Architecture cont… • The communication can be either of the following: • Connection less protocol • Connection - oriented protocol Compiled by: Miraf Belyu
Centralized Architecture cont… Connectionless protocol • If the underlying network is fairly reliable as in many local-area networks Compiled by: Miraf Belyu
How Connectionless protocol works • How client requests a service: • Packagesa message for the server • Identifyingthe service it wants • Include necessary input data • The message is then sent to the server. Compiled by: Miraf Belyu
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 Compiled by: Miraf Belyu
Centralized Architecture cont… Connection - oriented protocol • Is 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 Compiled by: Miraf Belyu
Cont… For example, • All Internet application protocols are based on reliable TCP/IP connections. Compiled by: Miraf Belyu
How connection – oriented protocol works • When client requests a service: • Sets up a connection to the server before sending the request • Servergenerally uses that same connection to send the reply message Compiled by: Miraf Belyu
Cons of connection – oriented protocol • Setting up and tearing down a connection is relatively costly, especially when the request and reply messages are small. Compiled by: Miraf Belyu
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 Compiled by: Miraf Belyu
Cont.… Search Engine Example Compiled by: Miraf Belyu
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 Compiled by: Miraf Belyu
Decentralized Architecture • Horizontal distribution • Clientor 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 Compiled by: Miraf Belyu
Structured peer – to – peer Arch • Network is constructed using a deterministic procedure like Distributed Hash Table (DHT) Compiled by: Miraf Belyu
Structured peer to peer cont … Distributed Hash Table (DHT) • Data items are assigned a random key (128-bit or 160-bit identifier) • Nodesassigned 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 Compiled by: Miraf Belyu
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 Compiled by: Miraf Belyu
Cont.. • When a node needs to locate a specific data item, it floods the network with a search query. • Alternative way: • Super-peers Compiled by: Miraf Belyu
Super - peers • Make use of special nodes that maintain an index of data items Compiled by: Miraf Belyu
Super – peer cont • Problem • select the nodes that are eligible to become super peer • Leader-election problem Compiled by: Miraf Belyu
Hybrid Architecture Compiled by: Miraf Belyu
Hybrid Architecture • Client-serversolutions are combined with decentralized architectures • Edge-Server Systems • Collaborative Distributed Systems Compiled by: Miraf Belyu
Edge – Server Systems • Deployed on the Internet • Servers are placed "at the edge" of the network • Boundary between enterprise networks and the actual Internet Compiled by: Miraf Belyu
Edge – Server Systems Compiled by: Miraf Belyu
Collaborative Distributed Systems • Once a node has joined the system, it can use a fully decentralized scheme for collaboration. • BitTorrent Compiled by: Miraf Belyu
BitTorrent implementation Compiled by: Miraf Belyu