DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S. TANENBAUM MAARTEN VAN STEEN Chapter 2 ARCHITECTURES Modified by Dr. Gheith Abandah Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 Overview • • • • Architectural styles System architectures Architectures versus middleware Self-management in distributed systems Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 Architectural Styles Important styles logical/software architecture for distributed systems: 1.Layered architectures 2.Object-based architectures 3.Event-based architectures 4.Data-centered architectures Usually organize into logically different components, and distribute those components over the various machines. Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 1. Layered architectural style Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 2. Object-based architectural style Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 3. Event-based architectural style Publish/subscribe systems [decoupled in space]. Published events reach subscribed processes. Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 4. Shared data-space architectural style Shared dataspace [decoupled in space and time] Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 System Architectures Important styles of hardware architecture for distributed systems: 1.Centralized architectures 1. Basic client-server 2. Application layering 3. Multi-tiered architectures 2.Decentralized architectures 1. Structured P2P 2. Unstructured P2P 3. Hybrid P2P 3.Hybrid architectures Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 1. Centralized Architectures Basic client-server model (1) • • • • There are processes offering services (servers) There are processes that use services (clients) Clients and servers can be on different machines Clients follow request/reply model wrt to using services Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 1. Centralized Architectures Basic client-server model (2) • Connectionless protocols • • • • Request/reply On time out, resend May create problems Connection-oriented protocols • Set up and tear down connections Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 1. Centralized Architectures Application Layering (1) Traditional three-layered view • • • User-interface layer contains units for an application’s user interface Processing layer contains the functions of an application, i.e., without specific data Data layer contains the data that a client wants to manipulate through the application components This layering is found in many distributed information systems, using traditional database technology and accompanying applications. Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 1. Centralized Architectures Application Layering (2) Example: The simplified organization of an Internet search engine into three different layers. Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 1. Centralized Architectures Multitiered Architectures (1) • • • Single-tiered: dumb terminal/mainframe configuration Two-tiered: client/single server configuration Three-tiered: each layer on separate machine Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 1. Centralized Architectures Multitiered Architectures (2) The simplest organization is to have only two types of machines: • A client machine containing only the programs implementing (part of) the userinterface level • A server machine containing the rest, – the programs implementing the processing and data level Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 1. Centralized Architectures Multitiered Architectures (3) Alternative client-server organizations Examples: (a) terminal, (c) forms, (e) PC, (e) PC with cache Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 1. Centralized Architectures Multitiered Architectures (4) Three-tiered system: An example of a server acting as client. Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 2. Decentralized Architectures We have been seeing recently a tremendous growth in peer-to-peer systems. 1.Structured P2P: nodes are organized following a specific distributed data structure 2.Unstructured P2P: nodes have randomly selected neighbors 3.Hybrid P2P: some nodes are appointed special functions in a well-organized fashion In virtually all cases, we are dealing with overlay networks: data is routed over connections setup between the nodes (cf. applicationlevel multicasting) Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 2. Decentralized Architectures Structured P2P (1) Organize the nodes in a structured overlay network such as a logical ring, and make specific nodes responsible for services based only on their ID The system provides an operation LOOKUP(key) that will efficiently route the lookup request to the associated node. DHT: Distributed hash table Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 2. Decentralized Architectures Structured P2P (2) Example: The mapping of data items onto nodes in content addressable network (CAN). Organize nodes in a ddimensional space and let every node take the responsibility for data in a specific region. Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 2. Decentralized Architectures Structured P2P (3) Splitting a region when a node joins. Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 2. Decentralized Architectures Unstructured P2P Many unstructured P2P systems attempt to maintain a random graph (overlay network). • Randomly construct list of neighbors • Randomly distribute data • Flood the network with search queries Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 2. Decentralized Architectures Hybrid P2P, Superpeers A hierarchical organization of nodes into a superpeer network. The peers maintain the data index. Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 3. Hybrid Architectures Hybrid Architectures: Client-server combined with P2P 1.Edge-server systems 2.Collaborative distributed systems Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 3. Hybrid Architectures Edge-Server Systems Edge-server architectures, which are often used in Content Delivery Networks, e.g. Internet. Viewing the Internet as consisting of a collection of edge servers. Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 3. Hybrid Architectures Collaborative Distributed Systems (1) • Client-server to join • Then decentralized collaboration • Often tit-for-tat Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 3. Hybrid Architectures Collaborative Distributed Systems (2) BitTorrent example: Once a node has identified where to download a file from, it joins a swarm of downloaders who in parallel get file chunks from the source, and distribute these chunks amongst each other. Get chunks from multiple nodes. Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 3. Hybrid Architectures Collaborative Distributed Systems (3) Globule collaborative content distribution network allows replicating web pages on multiple servers, components: • 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. Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 Architectures Versus Middleware • • Where does the middleware fit in the arch.? Middleware solutions: • • • Object-based architectural style, e.g., CORBA Event-based architectural style, e.g., TIB In many cases, distributed systems/applications are developed according to a specific architectural style. The chosen style may not be optimal in all cases, therefore, need to (dynamically) adapt the behavior of the middleware. Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 Architectures Versus Middleware Solution: Interceptors Intercept the usual flow of control when invoking a remote object. At request level, can handle replications of B. At message level, can fragment the message containing large “value”. Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 General Approaches to Adaptive Software • • • Separation of concerns: Try to separate extra functionalities and later weave them together into a single implementation. But how to handle a concern such as security?! Computational reflection: Let a program inspect itself at runtime and adapt/change its settings dynamically if necessary → mostly at language level and applicability unclear. Component-based design: Organize a distributed application through components that can be dynamically replaced when needed → highly complex, also many intercomponent dependencies. Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 Self-managing Distributed Systems • Automatic adaptation: need to be taken into account: • • • • • Self-configuration Self-managing Self-healing Self-optimizing Self-* Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 Self-managing Distributed Systems The Feedback Control Model The logical organization of a feedback control system. In many cases, self-* systems are organized as a feedback control system. Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 Self-managing Distributed Systems Example 1: Astrolabe • • • • • For system monitoring in large distributed system. Hierarchy of zones to collect information and communicate Hosts run special agent Supports queries similar to SQL Gossiping protocol to exchange info Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 Example 1: Systems Monitoring with Astrolabe Data collection and information aggregation in Astrolabe Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 Example 2: Selecting Replication Strategies in Globule (1) • The edge-server model assumed by Globule • Globule origin server collects traces and does what-if analysis by checking what would have happened if page P would have been placed at edge server S. • Many strategies are evaluated, and the best one is chosen. Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 Example 2: Selecting Replication Strategies in Globule (2) The dependency between prediction accuracy and trace length Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 Example 3: Automatic Component Repair Management in Jade In clusters, need to add/remove components at runtime. Each node/server has components, failure detectors, and node manager. Steps required in a repair procedure: 1. 2. 3. 4. Terminate every binding between a component on a non-faulty node, and a component on the node that just failed. Request the node manager to start and add a new node to the domain. Configure the new node with exactly the same components as those on the crashed node. Re-establish all the bindings that were previously terminated. Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5