client-server architecture - iowa state universityhome.eng.iastate.edu/~othmanel/files/se339/module...

30
Client-Server Architecture Lotfi ben Othmane

Upload: others

Post on 27-Aug-2021

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

Client-Server Architecture

Lotfi ben Othmane

Page 2: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

1. Understand client/server architecture

2

Learning Outcomes

Page 3: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

Architecture is defined by the recommended practice as the fundamental organization of a system, embodied in its components, their relationships to each other and the

environment, and the principles governing its design and evolution.

ANSI/IEEE Std 1471-2000, Recommended Practice for Architectural Description of Software-Intensive Systems

3

What is Software Architecture?

Page 4: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

Reference architecture provides an overall logical structure for a particular type of application.

4

Reference Architecture

Page 5: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

5

Single-Process Architecture

Page 6: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

Reference architectures for single-process applications:

1. Desktop application2. Embedded system3. Mobile application4. Service

6

Single-Process Applications

Page 7: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

Is this git a desktop application?7

Client/Server Application

Page 8: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

One server and a set of clients8

Client/Server Application

Server

Client 2Client 1

Client 3 Client 4

Page 9: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

• A client-server style is a style that involves client processes and a server process that communicate through a network. A server could be accessed by many clients and a client can access many servers.

• A client sends requests, gets replies, and processes them.

• Examples: Email, database systems, etc.

• Variation of structures: Application servers, P2P (peer to peer), Client-Queue-Client-System (e.g. chat).

9

Client-Server Style

Page 10: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

Client-server model is a distributed application model where tasks are partitioned between the client and server.

10

Client-Server Architecture

Secure Shell (SSH)

Server

SSH Client 2

SSH Client 3

SSH Client 1

SSH Client 3

Page 11: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

11

Putty – SSH Client

https://en.wikipedia.org/wiki/Secure_Shell

Page 12: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

What operations does ssh need to support?

12

Client-Server Architecture

SSH Server

SSH Client 2

SSH Client 3

SSH Client 1

SSH Client 3

Page 13: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

Client-Server Architecture

• Login• Send commands• Display command results• Logout• Create application session• Execute commands• Close session

13

SSH Operations

Example of operations to be performed by the client and server.Note: There is no order of the lists’ items.

Page 14: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

Now we need to split the operations between the client component and server component. Then we need to specify the interactions between both components

14

Exercise – Client-Server Architecture

SSH Server

SSH Client 2

SSH Client 3

SSH Client 1

SSH Client 3

Page 15: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

Client-Server Architecture

Client• Send username• Send password• Send commands• Set application session• Display command results• Request logout

Server• Accept username• Verify password• Create application session• Execute commands• Close session

15

Example of operations to be performed by the client and server.Note: There is no order of the lists’ items.

Page 16: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

You should consider the style to:

• Support many clients (web applications, business processes…).

• Centralize data and management functions.• Support many different types of clients.

16

Uses of the Style

Page 17: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

Problems associated with sharing resources include:• Managing the availability of resources for the clients at the

server• Managing the concurrency to access the resources• Controlling the performance of the server• Managing accesses to the clients scopes• Diversity of the clients operating systems• And more…

How would you solve these problems?

17

Uses of the Style – Cont.

Page 18: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

18

Benefits - Ease of Data Management

One process can manage several accesses to the data

Page 19: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

19

Benefits - Ease of Maintenance

We deploy only one application server. Each user can install a version of the client.

Page 20: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

20

Disadvantages - Scalability

Scaling the server component requires scaling both the data and the business logic together.

Git Repository

Git Repository

Page 21: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

21

Disadvantages - Reliability

Failure of THE server affects all the users.

Page 22: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

We wanted to share documents but,

• Do not have physical access to clients.• Do not want to deploy the client application on the

desktops.• Need to support different hardware types.• Need to support different operation systems (Linux, OS2,

DOS/Windows, MAC OS).

22

History

Page 23: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

Web browsers communicate with a server using the HTTP protocol

23

Simple Application – Web Sites

Web Browser

Server

HTTP + HTML

Page 24: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

• We want to get data from the user and respond based on their requests – dynamic web pages.

• Each component is assigned a set of responsibilities.

24

Web Applications

Page 25: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

Use web applications when:

1. You do not want to deploy software at the client host2. There’s a need for the user interface to be portable3. The application can be used over the Internet4. Its ok to have restricted access to resources at the client

25

Web Applications

Page 26: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

But what if:

1. You do not want to deploy software at the client host2. There’s a need for the user interface to be portable3. The application can be used over the Internet4. Its ok to have restricted access to resources at the client5. There is a need to access resources of the client

26

Page 27: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

Rich Client Applications

• Rich internet applications typically run inside a browser. They support rich user interaction and business logic.

• Some business logic may be executed on the host machine.

• May use local resources.

27

Page 28: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

Reasons to use rich client applications:

• We need a rich interface that runs in a browser.• We need to perform complex business logic on the client’s

machine.• The deployment of the application is simple.• Loading time is acceptable.

28

Rich Client Applications

Page 29: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

Architecture references (like client/server, web app) solve common challenges through the structure of the software: sharing data and processing, portability and deployability.

Architects fit their components into the reference architecture and use existing technologies such as web servers and database management systems as third-party software to address their needs.

29

So…

Page 30: Client-Server Architecture - Iowa State Universityhome.eng.iastate.edu/~othmanel/files/SE339/Module 3...peer), Client-Queue-Client-System (e.g. chat). 9 Client-Server Style Client-servermodel

Thank You

30