Upload
andrew-hardy
View
217
Download
0
Embed Size (px)
Citation preview
Software Architecture
• Describe how the various software components are to be organized and how they should interact.
• It describe the organization and interaction of software components.
System Architecture
• An architecture description is a formal description and representation of a system.
• It describe the placement of software components on physical machines.
Architectural Styles
Important styles of architecture for distributed systems
• Layered architectures• Object-based architectures• Data-centered architectures• Event-based architectures
Architectural Styles
• Layered architectures• Components are organized in a layered fashion
where a component at layer Li is allowed to call components at the underlying layer Li-1.
• Requests go down the hierarchy whereas the results flow upward.
• Object-based architectures• Each component are connected through a remote
procedure call mechanism• Similar to client server architecture.• Form the most important styles for the large
software systems
• less structured • component = object • connector = RPC or RMI
• Data-centered architectures• Communication processes through a common
repository• All communication takes place through files
• Event-based architectures• Communication through the propagation of
events• Propagation is associated with publish/subscribe
systems.• It means that processes publish events after which
the middleware ensures that only those processes that subscribed to those events will receive them.
• The main advantage of event-base architecture is that processes are loosely coupled.ie they were referentially decoupled.
• Event-based arch. supports several communication styles:
• Publish-subscribe • Broadcast • Point-to-point
• Shared data spaces• Access and update of data store is the main
purpose of data-centered system.• Processes communicate/exchange info primarily
by reading and modifying data in some shared repository (e.g database, distributed file system)
• e.g. processes of many web-based distributed systems communicate through the use of shared Web-based data services.
– Event based architectures can be combined with data-centered architectures .
– Processes are decoupled in time– Use SQL like interface
Centralized Architectures
• Example is client server model• In the basic client-server model, processes in a
distributed system are divided into two groups.• SERVER AND CLIENT
• A server is a process implementing a specific service .
• A client is a process that requests a service by sending it a request and subsequently waiting for the server’s reply. This type of client-server interaction is called request-reply behavior.
• Idempotent operation– When an operation can be repeated multiple
times without harm, it is said to be idempotent.• Examples • Web search engine Interface: type in a
keyword string Processing level: processes to generate DB queries, rank replies, format response Data level: database of web pages
Application Layering Three levels are
– The user-interface level– The processing level– The data level
• User interface level contains all that is necessary to directly interface with the user, such as display management.
• Processing level contains the applications.• The data level manages the actual data that is being
acted on. An important property of this level is that data is persistent.
• For example, Internet search engine
Multitier Architectures
The simplest organization is to have only two types of machines:
• A client machine containing only the programs implementing (part of) the user-interface level
• A server machine containing the rest, ie.the programs implementing the processing and data level.
• Following figure shows a two tier architecture.
• Fat clients and thin clients• Having more functionality on the client
machine makes client-side software more prone to errors.
• Following figure shows the three tired architecture.
• Vertical distribution refers to the distribution of the different layers in a multitier architectures across multiple machines.
• In principle, each layer is implemented on a different machine.
• Traditional client-server architectures exhibit vertical distribution. Each level serves a different purpose in the system.– Logically different components reside on different nodes
Decentralized Architectures
• Vertical distribution– In many business environments, distributed processing is
equivalent to organizing a client server application as a multitier architecture. this type of distribution is known as vertical distribution.
– The characteristic feature of vertical distribution is that it is achieved by placing logically different components on different machines.
– This is related to vertical fragmentation in distributed relational databases, it means that tables are split column wise and subsequently distributed across multiple machines.
• Horizontal distribution– In this type of distribution, a 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, thus balancing the load.
– The system architecture that supports horizontal distribution is known as peer- to- peer systems(P2P systems). Here nodes act as both client and server and the interaction is symmetric
– Horizontal distribution deals with the distribution of a single layer across multiple machines, such as distributing a single database.
• It has
• Better load balancing,• more resistant to denial-of-service attacks, • harder to manage than C/S
An example of horizontal distribution of a Web serviceThe replication serves for scalability and enhanced performance
• Servent– servent is a peer-to-peer network node, which
has the functionalities of both a server and a client.
– Each process will act as a client and a server at the same time.
Overlay network• A network in which the nodes are formed by the
processes and the links represent the possible communication channels.
• Overlay networks connect nodes in the P2P system– Define the structure between nodes in the system– Allow nodes to route requests to locations that
may not be known at time of request.
• Are virtual networks, built on top of one or more other networks.
• A link between two nodes in the overlay may consist of several physical links.
Circles represent nodes in the network. Blue nodes are also part of the overlay network. Dotted lines represent virtual links. Actual routing is based on TCP/IP protocols
Overlay Network Example
Overlay Networks
• Each node in a P2P system knows how to contact several other nodes.
• The overlay network may be two types.– structured P2P
• nodes and content are connected according to some design that simplifies later lookups
– unstructured P2P• content is assigned to nodes without regard to the
network topology.
Structured Peer-to-Peer Architectures
• In a structured peer-to-peer architecture, the overlap network is constructed using a deterministic procedure
• Organize the process through a distributed hash table (DHT).
• In a DHT based system, data items are assigned a random key from a large identifier space, such as a 128 bit or 160- bit identifier.
Structured P2P Architectures• A common approach is to use a distributed
hash table (DHT) to organize the nodes• Traditional hash functions convert a key to a
hash value, which can be used as an index into a hash table.– Keys are unique – each represents an object to
store in the table; e.g., at UAH, your A-number – The hash function value is used to insert an object
in the hash table and to retrieve it.
Structured P2P Architectures
• In a DHT, data objects and nodes are each assigned a key which hashes to a random number from a very large identifier space (to ensure uniqueness)
• A mapping function assigns objects to nodes, based on the hash function value.
• A lookup, also based on hash function value, returns the network address of the node that stores the requested object.
Characteristics of DHT
• Scalable – to thousands, even millions of network nodes– Search time increases more slowly than size;
usually Ο(log(N))• Fault tolerant – able to re-organize itself when
nodes fail• Decentralized – no central coordinator
(example of decentralized algorithms)
Structured Peer-to-Peer Architectures • Accomplished by routing a request for a data item to
the responsible node• The Chord system
• Ring • A data item with key k is mapped to the node
with the smallest identifier id >=k• The successor of the key k and denoted as succ(k)• LOOKUP(k) – return the network address of
succ(k)
Chord Routing AlgorithmStructured P2P
• Nodes are logically arranged in a circle• Nodes and data items have m-bit identifiers
(keys) from a 2m namespace.– e.g., a node’s key could be a hash of its IP address
and a file’s key might be the hash of its name or of its content.
– Can’t do key-word searches with this approach.
Structured Peer-to-Peer Architectures
• Content addressable network (CAN)• When a node p wants to join a CAN
• Pick up an arbitrary point from the coordinate space
• Look up the node Q in whose region that point falls
• Node Q then splits its region into two halves
Unstructured Peer-to-Peer Architectures
• Rely on randomized algorithms for constructing an overlay network
• The list of neighbors is also referred to as a partial view
• Assuming that entries need to be pushed to the selected peer
• If the node is in pull mode, it will waits for a response from the selected peer
Unstructured P2P
• Unstructured P2P organizes the overlay network as a random graph.
• Each node knows about a subset of nodes, its “neighbors”.– Neighbors are chosen in different ways: physically
close nodes, nodes that joined at about the same time, etc. -
• Data items are randomly mapped to some node in the system & lookup is random, unlike the structured lookup in Chord.
Comparison
• Structured networks typically guarantee that if an object is in the network it will be located in a bounded amount of time – usually O(log(N))
• Unstructured networks offer no guarantees.– For example, some will only forward search requests a
specific number of hops– Random graph approach means there may be loops– Graph may become disconnected
Superpeers
• In a collaborative content delivery network(CDN) nodes may offer storage for hosting copies of web pages allowing web clients to access pages nearby, and thus to access them quickly.
• The use of broker that collects resource usage for a number of nodes that are in each other’s proximity will allow to quickly select a node with sufficient resources.
• Nodes such as those maintaining an index or acting as a broker are generally referred to as superpeers.
• They are organized in a peer-to-peer network, leading into a hierarchical organization.
• In this hierarchical organization, every regular peer is connected as a client to a superpeer.
• All communication from and to a regular peer proceeds through that peer’s associated superpeer.
• The client – superpeer relation is fixed. Whenever a regular peer joins the network, it attaches to one of the superpeers and remains attached until it leaves the network.
Hybrid Architectures• Combine client-server and P2P architectures
– Edge-server systems; e.g. ISPs, which act as servers to their clients, but cooperate with other edge servers to host shared content.
– Collaborative distributed systems; e.g., BitTorrent, which supports parallel downloading and uploading of chunks of a file. First, interact with C/S system, then operate in decentralized manner.
Edge – Server Systems
• These systems are deployed in the Internet where servers are placed “at the edge” of the network.
• Eg: Internet Service Provider(ISP)
Collaborative Distributed Systems
Components of Globule collaborative content distribution network:
• 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.
Collaborative Distributed Systems BitTorrent
• Clients contact a global directory (Web server) to locate a .torrent file with the information needed to locate a tracker; a server that can supply a list of active nodes that have chunks of the desired file.
• Using information from the tracker, clients can download the file in chunks from multiple sites in the network. Clients must also provide file chunks to other users.
ARCHITECTURES VERSUS MIDDLEWARE
• middleware forms a layer between applications and distributed platforms.
• to a certain extent hiding the distribution of-data, processing,and control from applications.
• many middleware solutions have adoptedan object-based architectural style, such as CORBA• Others,like TIB/Rendezvous (TIBCO, 2005) provide
middleware that follows the event-based architectural style
• An approach that is generally considered better is to make middleware systems such that they are easy to configure, adapt, and customize as needed by anapplication.
• commonly followed approaches.• Interceptors -an interceptor is nothing but a software
construct that willbreak the usual flow of control and allow other (application specific) code to be executed.
interception as supported in many object based distributed systems.
• The basic idea is simple: an object A can call a method that belongs to an object B, while the latter resides on a different machine than A.
• a remote-object invocation is carried as a three-step approach:• 1. Object A is offered a local interface that is exactly the same as the
interface offered by object B. A simply calls the method available in'• that interface.• 2. The call by A is transformed into a generic object invocation, made
possible through a general object-invocation interface offered by themiddleware at the machine where A resides.
• 3. Finally, the generic object invocation is transformed into a message that is sent through the transport-level network interface as offered by A's local operating system.
General Approaches to Adaptive Software
• What interceptors actually offer is a means to adapt the middleware.
• The need for adaptation comes from the fact that the environment in which distributed applications are executed changes continuously.
• Changes include those resulting from mobility, a strong variance in the quality-of-service of networks, failing hardware, and battery drainage, amongst others.
• Rather than making applications responsible for reacting to changes, this task is placed in the middleware.
• These strong influences from the environment have brought many designers of middleware to consider the construction of adaptive software.
• three basic techniques to come to software adaptation:
1. Separation of concerns2. Computational reflection3. Component-based design
Separating concerns - way of modularizing systems• separate the parts that implement functionality from
those that take care of other things (known as extra functionalities) such as reliability, performance, security,etc.
• main problem is that we cannot easily separate these extra functionalities by means of modularization.
• For example, simply putting security into a separatemodule is not going to work
• it is hard to imagine how fault tolerance can be isolated into a separate box and sold as an independent service
Computational reflection
• ability of a program to inspect itself and, if necessary, adapt its behavior.
• Reflection has been built into programming languages, including Java, and offers a powerful facility for runtime modifications.
• In addition, some middleware systems provide the means to apply reflective techniques.
component-based design
• adaptation through composition• A system may either be configured statically at
design time, or dynamically at runtime.• The latter requires support for late binding, a
technique that has been successfully applied in programming language environments
SELF-MANAGEMENT IN DISTRIBUTED SYSTEMS
• distributed systems should be adaptive, but notably when it comes to adapting their execution behavior and not the software components they comprise.
• weneed to organize the components of a distributed system such that monitoring and adjustments can be done
• while on the other hand we need to decide where the processes are to be executed that handle the adaptation.
self-managing systems
• autonomic computing or self..star systems or self-managing systems- organizing distributed systems as high-level feedback-control systems allowing automatic adaptations to changes.
• the variety by which automatic adaptations are being captured: self-managing, self-healing, self-configuring, self-optimizing, and so on.
The Feedback Control Model
• Assumption that adaptations take place by means of one or more feedback control loops.
• Accordingly, systems that are organized by means of such loops are referred to as feedback control systems.
• Feedback control has since long been applied in various engineering fields, and its mathematical foundations are gradually also finding their way in computing systems
• The core of a feedback control system is formed by the components that need to be managed.
• These components are assumed to be driven through controllable input parameters, but their behavior may be influenced by all kinds of uncontrollable input, also known as disturbance or noise input.
Three elements that form the feedback control loop.
• First,the system itself needs to be monitored, which requires that various aspects of the system need to be measured.
• Another part of the feedback control loop analyzes the measurements and compares these to reference values. This feedback analysis component forms the heart of the control loop, as it will contain the algorithms that decide on possible adaptations.
• The last group of components consist of various mechanisms to directly influence the behavior of the system.(placing replicas, changing scheduling priorities etc)