Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

26
Client/Server Architectures Pictures from, Software Engineering 8, Sommerville

Transcript of Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

Page 1: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

Client/Server Architectures

Pictures from, Software Engineering 8, Sommerville

Page 2: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

System types Personal systems that are not distributed and

that are designed to run on a personal computer or workstation.

Embedded systems that run on a single processor or on an integrated group of processors.

Distributed systems where the system software runs on a loosely integrated group of cooperating processors linked by a network.

Page 3: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

Distributed system characteristics Resource sharing

Sharing of hardware and software resources. Openness

Use of equipment and software from different vendors. Concurrency

Concurrent processing to enhance performance. Scalability

Increased throughput by adding new resources. Fault tolerance

The ability to continue in operation after a fault has occurred.

Page 4: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

Distributed system disadvantages Complexity

Typically, distributed systems are more complex than centralised systems.

Security More susceptible to external attack.

Manageability More effort required for system management.

Unpredictability Unpredictable responses depending on the system

organisation and network load.

Page 5: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

Layered application architecture Presentation layer

Concerned with presenting the results of a computation to system users and with collecting user inputs.

Application processing layer Concerned with providing application specific functionality

e.g., in a banking system, banking functions such as open account, close account, etc.

Data management layer Concerned with managing the system databases.

Page 6: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

Application layers

Presentation layer

Application processinglayer

Data managementlayer

Page 7: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

Thin and fat clients Thin-client model

In a thin-client model, all of the application processing and data management is carried out on the server. The client is simply responsible for running the presentation software.

Fat-client model In this model, the server is only responsible for

data management. The software on the client implements the application logic and the interactions with the system user.

Page 8: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

Thin and fat clients

Thin-clientmodel

Fat-clientmodel Client

Client

Server

Data managementApplication processing

Presentation

Server

Data management

PresentationApplication processing

Page 9: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

Thin client model Used when legacy systems are migrated to

client server architectures. The legacy system acts as a server in its own right

with a graphical interface implemented on a client.

Used in data-intensive applications Web browsing

A major disadvantage is that it places a heavy processing load on both the server and the network.

Page 10: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

Thin clients Text terminals

Client presents text to users, reads input from keyboard X windows

Protocol to exchange desktop window information Provides for the use of desktop applications that execute

on a server Server required to actual create graphical appearance and

transmit to client Very slow for wide-area networking

Traditional Web Browser Built on text terminal idea

Adds photographic images Adds hyperlinks

URLs point from one page to another Does not provide complete applications like XWindows Much faster than Xwindows

Allows Web to work on global scale

Page 11: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

Xwindows versus Web Browser Xwindows

1. Server receives user input2. Server performs application processing3. Server puts computes changes required to GUI4. Server sends client GUI changes

Traditional Web Browser1. Server receives user input2. Server loads text and image resources for client3. Server provides a set of instructions for putting

resources together (HTML)4. Server sends client resources + instructions

Page 12: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

Fat client model More processing is delegated to the client as

the application processing is locally executed. Most suitable for new C/S systems where the

capabilities of the client system are known in advance.

More complex than a thin client model especially for management. New versions of the application have to be installed on all clients.

Page 13: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

Fat client examples

Online Multiplayer Games Multimedia Players Eclipse IDE Microsoft Outlook

Page 14: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

Hybrid Browser Models

Server-Side Scripting JavaScript Java Applets

Page 15: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

Hybrid Browser Models Server-Side Scripting

Instead of loading resources based on client request,Server loads resources based on application processing

Low latency at start-up time

Problem: High latency between user events

Page 16: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

Hybrid Browser Models JavaScript

Client performs minor application processing but only related to beautifying the user interface Example: Drop down menus, drag and drop, etc...

Low latency at startup-time

Low latency between user events

Problem: Limited to GUI

Page 17: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

Hybrid Browser Models Java Applets

Client downloads complete application on-demand

Application runs inside the browser Strong security, can’t execute machine instructions

directly

Low latency between user events

Problem: High latency at start-up time

Page 18: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

A client-server ATM system

Account server

Customeraccountdatabase

Tele-processingmonitor

ATM

ATM

ATM

ATM

Page 19: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

Three-tier architectures In a three-tier architecture, each of the application

architecture layers may execute on a separate processor.

Allows for better performance than a thin-client approach and is simpler to manage than a fat-client approach. More opportunities for caching Move slower components further away from clients to be

accessed only when necessary Middle-tier can further be split

Gives rise to multi-tier architecture Client – Web Server – Application Server – Data Management

Web server provides application routing to different applications hosted on different machines

Page 20: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

A 3-tier C/S architecture

Client

Server

Datamanagement

PresentationServer

Applicationprocessing

Page 21: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

New C/S Approaches Thin Clients

AJAX Fat Clients

Rich Clients

Page 22: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

AJAX Asynchronous JavaScript and XML Event-based architecture

Asynchronous, concurrent, communication with server

For web browsers Which use Javascript

Client/Server communicate through XML messages Why?

Client loads large Javascript file at startup which contains most user interface instructions

Further communication with server doesn’t need UI information so HTML is redundant

Page 23: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

AJAX Application processing is still on the server But ...

Client can process several events without loading new pages

Originally every interaction with server required a fresh web page to load

Page 24: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

AJAX

Page 25: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

Rich Clients Fat Clients with an automatic update feature Application is partitioned into core application

and other features through plugins Requires careful application decomposition If changes are require to core, user must

download whole new version Takes advantage of dynamic linked libraries

Modern compilers can linked together separately compiled class at application startup

Classes do not need to be compiled together

Page 26: Client/Server Architectures Pictures from, Software Engineering 8, Sommerville.

Use of C/S architectures

Architecture Applications

Two-tier C/Sarchitecture withthin clients

Legacy system applications where separating application processing anddata management is impractical.Computationally-intensive applications such as compilers with little orno data management.Data-intensive applications (browsing and querying) with little or noapplication processing.

Two-tier C/Sarchitecture withfat clients

Applications where application processing is provided by off-the-shelfsoftware (e.g. Microsoft Excel) on the client.Applications where computationally-intensive processing of data (e.g.data visualisation) is required.Applications with relatively stable end-user functionality used in anenvironment with well-established system management.

Three-tier ormulti-tier C/Sarchitecture

Large scale applications with hundreds or thousands of clientsApplications where both the data and the application are volatile.Applications where data from multiple sources are integrated.