lec03-architectures-p1.pdf

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Full Transcript

Distributed Systems (4th edition, version 01) Chapter 02: Architectures Architectural styles, Middleware, and Layered Architectures 1 Chapter 02: Architectures 2.1 Architectural styles 2.4 Symmetrically distributed Layered ar...

Distributed Systems (4th edition, version 01) Chapter 02: Architectures Architectural styles, Middleware, and Layered Architectures 1 Chapter 02: Architectures 2.1 Architectural styles 2.4 Symmetrically distributed Layered architectures system architectures Service-oriented Structured peer-to-peer Publish-subscribe Unstructured peer-to-peer Hierarchically organized 2.2 Middleware and distributed peer-to-peer networks systems Middleware organization 2.5 Hybrid system architectures Cloud computing 2.3 Layered-system The edge-cloud architecture architectures Blockchain architectures Simple client-server architecture Multitiered Architectures 2 Architectures Architectural styles 2.1. Architectural styles Basic idea A style is formulated in terms of (replaceable) components with well-defined interfaces the way that components are connected to each other the data exchanged between components how these components and connectors are jointly configured into a system. Connector A mechanism that mediates communication, coordination, or cooperation among components. Example: facilities for (remote) procedure call, messaging, or streaming. 3 Architectures Architectural styles Layered architecture 2.1.1. Layered architecture Different layered organizations (a) (b) (c) 4 Layered architectures Architectures Architectural styles Layered architecture Example: communication protocols Service – functionality offered; what the service does Interface – specifies how higher entities access the service Protocol - describes the rules to exchange information Example: TCP Two-party communication Service: Reliable communication over a network Interface: Socket Protocol: Transmission Control Protocol 5 Layered architectures Architectures Architectural styles Layered architecture Application Layering Traditional three-layered view Application-interface layer contains units for interfacing to users or external applications 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 6 Layered architectures Architectures Architectural styles Layered architecture Application Layering Traditional three-layered view Application-interface layer contains units for interfacing to users or external applications 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 Observation This layering is found in many distributed information systems, using traditional database technology and accompanying applications. 7 Layered architectures Architectures Architectural styles Layered architecture Application Layering Example: a simple search engine for house rentals 8 Layered architectures Architectures Architectural styles Layered architecture Layered Architecture Very popular Drawback: strong dependency between different layers if not well- designed Good example: communication protocol stacks Bad example: applications designed and developed as compositions of existing components without much concern for the stability of interfaces nor overlap of functionality between different components 9 Layered architectures Architectures Architectural styles 2.1.2 Service-oriented architectures Essence an architectural style reflecting a more loose organization into a collection of separate, independent entities. Each entity encapsulates a service the service is executed as a separate process (or thread) can be called service or object 10 Service-oriented architectures Architectures Architectural styles Service-oriented architecture Object-based style Essence Components are objects, connected to each other through procedure calls. Objects may be placed on different machines; calls can thus execute across a network. Encapsulation Objects are said to encapsulate data and offer methods on that data without revealing the internal implementation. 11 Service-oriented architectures Architectures Architectural styles Service-oriented architecture Remote Object Separation between interfaces and the objects implementing these interfaces allows us to place an interface at one machine, while the object itself resides on another machine. 12 Service-oriented architectures Architectures Architectural styles Service-oriented architecture Resource-based architectures Essence View a distributed system as a collection of resources, individually managed by components. Resources may be added, removed, retrieved, and modified by (remote) applications. Representational State Transfer (REST): RESTful architectures 1. Resources are identified through a single naming scheme 2. All services offer the same interface 3. Messages sent to or from a service are fully self-described 4. After executing an operation at a service, that component forgets everything about the caller Basic operations Operation Description PUT Create a new resource GET Retrieve the state of a resource in some representation DELETE Delete a resource POST Modify a resource by transferring a new state 13 Service-oriented architectures Architectures Architectural styles Service-oriented architecture RESTful architecture Example: Amazon’s Simple Storage Service Essence Objects (i.e., files) are placed into buckets (i.e., directories). Buckets cannot be placed into buckets. Operations on ObjectName in bucket BucketName require the following identifier: http://BucketName.s3.amazonaws.com/ObjectName Typical operations All operations are carried out by sending HTTP requests: Create a bucket/object: PUT, along with the URI Listing objects: GET on a bucket name Reading an object: GET on a full URI Issue Many people like RESTful approaches because the interface to a service is so simple. The catch is that much needs to be done in the parameter space. 14 Service-oriented architectures Architectures Architectural styles Service-oriented architecture On interfaces Simplifications Assume an interface bucket offering an operation create , requiring an input string such as mybucket, for creating a bucket “mybucket.” SOAP import bucket bucket.create("mybucket") RESTful PUT "https://mybucket.s3.amazonsws.com/" Conclusions Are there any to draw? 15 Service-oriented architectures Architectures Architectural styles Publish-subscribe architecture 2.1.3 Publish-subscribe architectures A large class of distributed systems have adopted an architecture in which there is a strong separation between processing and coordination Essence View system as a collection of autonomously operating processes. Coordination encompasses the communication and cooperation between processes glue that binds the activities performed by processes into a whole Coordination Models Temporal and referential coupling Temporal coupling - processes need to be available at the same time Referential coupling – processes need to to know the name or identifier of other process Temporally coupled Temporally coupled Referentially coupled Direct Mailbox Referentially decoupled Event-based Shared data space 16 Publish-subscribe architectures Architectures Architectural styles Publish-subscribe architecture 2.1.3 Publish-subscribe architectures Temporal and referential coupling Temporally coupled Temporally coupled Referentially coupled Direct Mailbox Referentially decoupled Event-based Shared data space Event-based and Shared data space 17 Publish-subscribe architectures Architectures Architectural styles Publish-subscribe architecture Shared Data Space Example: Linda tuple space Three simple operations i n ( t ) : remove a tuple matching template t r d ( t ) : obtain copy of a tuple matching template t o u t ( t ) : add tuple t to the tuple space More details Calling o u t ( t ) twice in a row, leads to storing two copies of tuple t ⇒ a tuple space is modeled as a multiset. Both i n and r d are blocking operations: the caller will be blocked until a matching tuple is found, or has become available. 18 Publish-subscribe architectures Architectures Architectural styles Publish-subscribe architecture Shared Data Space Example: Linda tuple space 1 import l i n d a 2 linda.connect() 3 4 blog = linda.TupleSpace() 5 linda.universe._out(("MicroBlog",blog)) Bob: 6 7 blog = linda.universe._rd(("MicroBlog",linda.TupleSpace)) 8 9 bl og._out (("bob","di st sys","I am studying chap 2 " ) ) 10 blog._out(("bob","distsys","The l i n d a example’s p r e t t y simple")) 11 blog._out(("bob","gtcn","Cool book!")) 1 import l i n d a 2 linda.connect() 3 Alice: 4 blog = linda.universe._rd(("MicroBlog",linda.TupleSpace)) 5 6 bl og._out (("al i ce","gt cn","Thi s graph t heory s t u f f i s n o t easy")) 7 b l o g. _ o u t ( ( " a l i c e " , " d i s t s y s " , " I l i k e systems more t ha n graphs")) 1 import l i n d a 2 linda.connect() 3 4 blog = linda.universe._rd(("MicroBlog",linda.TupleSpace)) 5 Chuck: 6 t 1 = blog._rd(("bob","distsys",str)) 7 t 2 = bl og._rd(("al i ce","gt cn",str)) 8 t 3 = blog._rd(("bob","gtcn",str)) 9 10 pri nt t 1 11 pri nt t 2 12 pri nt t 3 19 Publish-subscribe architectures Architectures Architectural styles Publish-subscribe architecture Publish and subscribe Issue: how to match events? Assume events are described by (attribute,value) pairs topic-based subscription: specify a “attribute = value” series content-based subscription: specify a “attribute ∈ range” series Observation Content-based subscriptions may easily have serious scalability problems (why?) 20 Publish-subscribe architectures Architectures Middleware and distributed systems Middleware 2.2 Middleware: the OS of distributed systems What does it contain? Commonly used components and functions that need not be implemented by applications separately: Facilities for inter-application communication. Security services. Accounting services. Masking of and recovery from failures. 21 Architectures Middleware and distributed systems Middleware Using legacy to build middleware Problem The interfaces offered by a legacy component are most likely not suitable for all applications. Solution A wrapper or adapter offers an interface acceptable to a client application. Its functions are transformed into those available at the component. 22 Middleware organization Architectures Middleware and distributed systems Middleware Organizing wrappers Two solutions: 1-on-1 or through a broker Complexity with N applications 1-on-1: requires N × ( N − 1) = O(N2) wrappers broker: requires 2N = O(N) wrappers 23 Middleware organization Architectures Middleware and distributed systems Middleware Intercept the usual flow of control if object B replicated service, each replica need to be invoked 24 Middleware organization Chapter 02: Architectures 2.1 Architectural styles 2.4 Symmetrically distributed Layered architectures system architectures Service-oriented Structured peer-to-peer Publish-subscribe Unstructured peer-to-peer Hierarchically organized 2.2 Middleware and distributed peer-to-peer networks systems Middleware organization 2.5 Hybrid system architectures Cloud computing 2.3 Layered-system The edge-cloud architecture architectures Blockchain architectures Simple client-server architecture Multitiered Architectures 25

Use Quizgecko on...
Browser
Browser