Network-based Architectural Styles
3.1 Classification Methodology
In order to provide useful design guidance, a classification of architectural styles should be based on the architectural properties induced by those styles.
3.1.1 Selection of Architectural Styles for Classification
3.1.2 Style-induced Architectural Properties
3.1.3 Visualization
3.2 Data-flow Styles
3.2.1 Pipe and Filter (PF)
Description: In a pipe and filter style, each component (filter) reads streams of data on its inputs and produces streams of data on its outputs, usually while applying a transformation to the input streams and processing them incrementally so that output begins before the input is completely consumed.
Characteristic:
1. One-way data flow network;
2. Zero coupling: a filter must be completely independent of other filters.
Advantage: (by Garlan and Shaw)
1. Simplicity: PF allows the designer to understand the overall input/output of the system as a simple composition of the behaviors of the individual filters.
2. Reusability: any two filters can be hooked together, provided they agree on the data that is being transmitted between them.
3. Extensibility and evolvability: new filters can be added to existing systems (extensibility) and old filters can be replaced by improved ones (evolvability).
4. Verifiability: they permit certain kinds of specialized analysis.
5. User-perceived performance: they naturally support concurrent execution.
6. Configurability: a network of filters is typically arranged just prior to each activation, allowing the application to specify the configuration of filter components based on the task at hand and the nature of the data streams.
Disadvantage:
1. Propagation delay: propagation delay is added through long pipelines;
2. Batch sequential processing occurs if a filter cannot incrementally process its inputs, and no interactivity is allowed.
3. A filter cannot interact with its environment: because it cannot know that any particular output stream shares a controller with any particular input stream.
4. User-perceived performance: these properties decrease user-perceived performance if the problem being addressed does not fit the pattern of a data flow stream.
3.2.2 Uniform Pipe and Filter (UPF)
Characteristic: the uniform pipe and filter style adds the constraint that all filters must have the same interface.
Advantage:
Example: Unix operating system, where filter processes have an interface consisting of one input data stream of characters (stdin) and two output data streams of characters (stdout and stderr).
1. Restricting the interface allows independently developed filters to be arranged at will to form new applications.
2. It also simplifies the task of understanding how a given filter works.
Disadvantage:
It may reduce network performance if the data needs to be converted to or from its natural format.
3.3 Replication Styles
3.3.1 Replicated Repository (RR)
Example: (1) distributed filesystems, such as XMS, and, (2) remote versioning systems, like CVS [www.cyclic.com].
Advantage: Improved user-perceived performance, both by reducing the latency of normal requests and enabling disconnected operation in the face of primary server failure or intentional roaming off the network(线下漫游).
Concern: Maintaining consistency is the primary concern.
3.3.2 Cache ($)
This form of replication is most often found in cases (1) where the potential data set far exceeds the capacity of any one client, as in the WWW, or (2) where complete access to the repository is unnecessary.
Advantage:caching is much easier to implement, doesn’t require as much processing and storage, and is more efficient because data is transmitted only when it is requested.
A typical network-based architectural style: client-stateless-server style (rest rationale).
3.4 Hierarchical Styles
3.4.1 Client-Server (CS)
Description:
1. A server component: offering a set of services, listens for requests upon those services.
A client component: desiring that a service be performed, sends a request to the server via a connector.
2. by Andrews:
A client is a triggering process;
A server is a reactive process.
Clients make requests that trigger reactions from servers.
A server is usually a non-terminating process and often provides service to more than one client.
Principle:Separation of concerns.
Simplify the server component in order to improve scalability.
Method: moving all of the user interface functionality into the client component.
The partition between C and S components: It is often referred to by the mechanisms used for the connector implementation, such as remote procedure call or message-oriented middleware.
3.4.2 Layered System (LS) and Layered-Client-Server (LCS)
Layered System:
1. A layered system is organized hierarchically, each layer providing services to the layer above it and using services of the layer below it.
2.Layered systems reduce coupling across multiple layers by hiding the inner layers from all except the adjacent outer layer. In all, in multiple layers, every layer only couples the adjacent outer layer, thus improving evolvability and reusability (e.g., TCP/IP and OSI protocol stacks, and hardware interface libraries).
3. Disadvantage:layered systems add overhead and latency to the processing of data, reducing user-perceived performance.
Layered-Client-Server:
Layered-client-server adds proxy and gateway components to the client-server style.
Client -> Proxy -> Gateway -> Server
A proxy acts as a shared server for one or more client components, taking requests and forwarding them, with possible translation, to server components.
A gateway component appears to be a normal server to clients or proxies that request its services, but is in fact forwarding those requests, with possible translation, to its “inner-layer” servers.
3.4.3 Client-Stateless-Server (CSS)
Characteristic: no session stateis allowed on the server component.
Each request from client to server must contain all of the information necessary to understand the request, and cannot take advantage of any stored context on the server. Session state is kept entirely on the client.
Advantage: visibility, reliability, and scalability.
Disadvantage:it may decrease network performance by increasing the repetitive data (per-interaction overhead) sent in a series of requests, since that data cannot be left on the server in a shared context.
3.4.4 Client-Cache-Stateless-Server (C$SS)
Characteristic: the client-cache-stateless-server style derives from the client-stateless-server and cache styles via the addition of cache components.
Description: A cache acts as a mediator between client and server in which the responses to prior requests can, if they are considered cacheable, be reused in response to later requests that are equivalent.
Example: an example system that makes effective use of this style is Sun Microsystems’ NFS.
Advantage: cache components have the potential to partially or completely eliminate some interactions, improving efficiency and user-perceived performance.
3.4.5 Layered-Client-Cache-Stateless-Server (LC$SS)
Characteristic: the layered-client-cache-stateless-server style derives from both layered-client-server and client-cache-stateless-server through the addition of proxy and/or gateway components.
Example: an example system that uses an LC$SS style is the Internet domain name system (DNS).
3.4.6 Remote Session (RS)
Characteristic: minimize the complexity, or maximize the reuse of the client components,andthe application state on server.
Description: each client initiates a session on the server and then invokes a series of services on the server, finally exiting the session. Application state is kept entirely on the server.
Example: when it is desired to access a remote service using a generic client (e.g., TELNET) or via an interface that mimics a generic client (e.g., FTP).
Advantage: (1) easier to centrally maintain the interface at the server, (2) reducing concerns about inconsistencies in deployed clients, and (3) improves efficiency if the interactions make use of extended session context on the server.
Disadvantage:(1) reduces scalability of the server, due to the stored application state, and, (2) reduces visibility of interactions, since a monitor would have to know the complete state of the server.
3.4.7 Remote Data Access (RDA)
Characteristic: the remote data access style is a variant of client-server that spreads the application state across both client and server.
Description: a client sends a database query in a standard format, such as SQL, to a remote server. The server allocates a workspace and performs the query,which may result in a very large data set. The client must know about the data structure of the service to build structure-dependent queries.
Advantage:
Eficiency: a large data set can be iteratively reduced on the server side without transmitting it across the network.
Visibility: is improved by using a standard query language.
Disadvantage:
Lacking simplicity: the client needs to understand the same database manipulation concepts as the server implementation
Decreases scalability: storing application context on the server decreases scalability.
Suffered reliability: partial failure can leave the workspace in an unknown state.
3.5 Mobile Code Styles
3.6 Peer-to-Peer Styles
3.7 Limitations
3.8 Related Work