Client-server architecture and the Web -...

Preview:

Citation preview

Client-server architecture

and the Web

Laura Farinetti

Dipartimento di Automatica e Informatica

Politecnico di Torino

laura.farinetti@polito.it

1

Web general architecture

2

Internet

LAN

Client

Web & authentication server(s)

Transaction server(s)

Database server(s)

ISP

ISP

Distributed systems

Software systems in which components located on networked computers communicate and coordinate their actions by passing messages ◦ The components interact with each other in order

to achieve a common goal

◦ Three significant characteristics are: concurrency of components, lack of a global clock, and independent failure of components

Two main models ◦ Client-server architectures

◦ Peer-to-peer architectures

3

Distributed systems

Originally referred computer networks where individual computers were physically distributed within a geographical area

Today used in a much wider sense, even referring to autonomous processes that run on the same physical computer and interact with each other by message passing

4

node

applications local

archives

users

node

applications node

applications

Client-server model

Distributed application structure that assigns tasks or workloads between

◦ The providers of a resource or service, called servers

◦ The service requesters, called clients

Servers are classified by the services they provide

◦ E.g., a web server serves web pages, a file server serves computer files

Clients and servers exchange messages in a request-response messaging pattern

◦ The client sends a request, and the server returns a response

5

Client-server vs peer-to-peer

6

Three-tier architecture

Client–server architecture in which

◦ user interface

◦ functional process logic ("business rules")

◦ computer data storage and data access

are developed and maintained as independent modules, most often on separate platforms

7

Web applications workflow

8

User

User interface

+ client-side processing

Server-side

processing

Data

source

User sends a

request through a

user interface

The request is

sent to the

server

The application replies

to the request (possibly)

using the data source

The data source

returns the request

result

The server-side

application returns

the request result

The request result

is shown to the

user

Interaction example

9

User interface

Result

Static transaction

10

Client

Web

server Internet

URL http request

HTML

files

http response display

page

TCP/IP

path

browser server file system

HTML

send

Static transaction: timeline

11

Browser

Web

server

Disk

access

t0

t1

t2

t3

t4

t6

t7

t8

t9

t5

t’0

t’1

total response time

server response time user think time

network transfer time

Dynamic transaction

12

Client

Web

server Internet

URL http request

& POST data

http response display

page

TCP/IP

com-

mand

browser server application

HTML

send

Application

para-

meters

logic

Dynamic transaction: timeline

13

Browser

Web

server

Application

server

t0

t1

t2

t3

t5

t6

t7

t8

t9

t4

total response time

application time

total server time

t’0

t’1

Database transaction

14

Client

Web

server Internet

URL http

& POST

http display

page

TCP/IP

com-

mand

browser server application

HTML

send

Application

para-

meters

database

data

Database

query

Database transaction: timeline

15

Browser

Web

server

Application

server

Database

server

t0

t1

t2

t3

t5

t6

t7

t8

t9

t4

t’0

t’1

total response time

application time

total server time

database time

Web technologies and languages

16

Client-side technologies

Server-side technologies

Web technologies and languages

17

HTML + CSS (static pages only)

+ JavaScript

Ruby on Rails

SQL

Example: EasyPHP

EasyPHP is a WAMP package including ◦ the web server Apache

◦ a the server-side PHP interpreter

◦ the SQL server MySQL

◦ development tools such as the database manager PhpMyAdmin

WAMP = Windows, Apache, MySQL, and PHP

EasyPHP installs all sotware required to develop a web site locally (no internet connection required) ◦ the PC becomes client and server

◦ virtual domain (localhost) -> http://127.0.0.1

18

Web technologies and languages

19

HTML + CSS (static pages only)

+ JavaScript

PHP

MySQL

EasyPHP

Licenza d’uso

Queste diapositive sono distribuite con licenza Creative Commons “Attribuzione - Non commerciale - Condividi allo stesso modo 2.5 Italia (CC BY-NC-SA 2.5)”

Sei libero:

◦ di riprodurre, distribuire, comunicare al pubblico, esporre in pubblico, rappresentare, eseguire e recitare quest’opera

◦ di modificare quest'opera

Alle seguenti condizioni:

◦ Attribuzione — Devi attribuire la paternità dell’opera agli autori originali e in modo tale da non suggerire che essi avallino te o il modo in cui tu usi l'opera.

◦ Non commerciale — Non puoi usare quest’opera per fini commerciali.

◦ Condividi allo stesso modo — Se alteri o trasformi quest’opera, o se la usi per crearne un’altra, puoi distribuire l’opera risultante solo con una licenza identica o equivalente a questa.

http://creativecommons.org/licenses/by-nc-sa/2.5/it/ 20

Recommended