client-server architecture and the web -...

20
Client-server architecture and the Web Laura Farinetti Dipartimento di Automatica e Informatica Politecnico di Torino [email protected] 1

Upload: danghuong

Post on 14-Feb-2019

261 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Client-server architecture and the Web - polito.itelite.polito.it/.../02NPYPD/2013-2014/lucidi/moduloA/02-ArchWeb.pdf · Client-server architecture and the Web Laura Farinetti Dipartimento

Client-server architecture

and the Web

Laura Farinetti

Dipartimento di Automatica e Informatica

Politecnico di Torino

[email protected]

1

Page 2: Client-server architecture and the Web - polito.itelite.polito.it/.../02NPYPD/2013-2014/lucidi/moduloA/02-ArchWeb.pdf · Client-server architecture and the Web Laura Farinetti Dipartimento

Web general architecture

2

Internet

LAN

Client

Web & authentication server(s)

Transaction server(s)

Database server(s)

ISP

ISP

Page 3: Client-server architecture and the Web - polito.itelite.polito.it/.../02NPYPD/2013-2014/lucidi/moduloA/02-ArchWeb.pdf · Client-server architecture and the Web Laura Farinetti Dipartimento

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

Page 4: Client-server architecture and the Web - polito.itelite.polito.it/.../02NPYPD/2013-2014/lucidi/moduloA/02-ArchWeb.pdf · Client-server architecture and the Web Laura Farinetti Dipartimento

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

Page 5: Client-server architecture and the Web - polito.itelite.polito.it/.../02NPYPD/2013-2014/lucidi/moduloA/02-ArchWeb.pdf · Client-server architecture and the Web Laura Farinetti Dipartimento

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

Page 6: Client-server architecture and the Web - polito.itelite.polito.it/.../02NPYPD/2013-2014/lucidi/moduloA/02-ArchWeb.pdf · Client-server architecture and the Web Laura Farinetti Dipartimento

Client-server vs peer-to-peer

6

Page 7: Client-server architecture and the Web - polito.itelite.polito.it/.../02NPYPD/2013-2014/lucidi/moduloA/02-ArchWeb.pdf · Client-server architecture and the Web Laura Farinetti Dipartimento

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

Page 8: Client-server architecture and the Web - polito.itelite.polito.it/.../02NPYPD/2013-2014/lucidi/moduloA/02-ArchWeb.pdf · Client-server architecture and the Web Laura Farinetti Dipartimento

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

Page 9: Client-server architecture and the Web - polito.itelite.polito.it/.../02NPYPD/2013-2014/lucidi/moduloA/02-ArchWeb.pdf · Client-server architecture and the Web Laura Farinetti Dipartimento

Interaction example

9

User interface

Result

Page 10: Client-server architecture and the Web - polito.itelite.polito.it/.../02NPYPD/2013-2014/lucidi/moduloA/02-ArchWeb.pdf · Client-server architecture and the Web Laura Farinetti Dipartimento

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

Page 11: Client-server architecture and the Web - polito.itelite.polito.it/.../02NPYPD/2013-2014/lucidi/moduloA/02-ArchWeb.pdf · Client-server architecture and the Web Laura Farinetti Dipartimento

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

Page 12: Client-server architecture and the Web - polito.itelite.polito.it/.../02NPYPD/2013-2014/lucidi/moduloA/02-ArchWeb.pdf · Client-server architecture and the Web Laura Farinetti Dipartimento

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

Page 13: Client-server architecture and the Web - polito.itelite.polito.it/.../02NPYPD/2013-2014/lucidi/moduloA/02-ArchWeb.pdf · Client-server architecture and the Web Laura Farinetti Dipartimento

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

Page 14: Client-server architecture and the Web - polito.itelite.polito.it/.../02NPYPD/2013-2014/lucidi/moduloA/02-ArchWeb.pdf · Client-server architecture and the Web Laura Farinetti Dipartimento

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

Page 15: Client-server architecture and the Web - polito.itelite.polito.it/.../02NPYPD/2013-2014/lucidi/moduloA/02-ArchWeb.pdf · Client-server architecture and the Web Laura Farinetti Dipartimento

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

Page 16: Client-server architecture and the Web - polito.itelite.polito.it/.../02NPYPD/2013-2014/lucidi/moduloA/02-ArchWeb.pdf · Client-server architecture and the Web Laura Farinetti Dipartimento

Web technologies and languages

16

Client-side technologies

Server-side technologies

Page 17: Client-server architecture and the Web - polito.itelite.polito.it/.../02NPYPD/2013-2014/lucidi/moduloA/02-ArchWeb.pdf · Client-server architecture and the Web Laura Farinetti Dipartimento

Web technologies and languages

17

HTML + CSS (static pages only)

+ JavaScript

Ruby on Rails

SQL

Page 18: Client-server architecture and the Web - polito.itelite.polito.it/.../02NPYPD/2013-2014/lucidi/moduloA/02-ArchWeb.pdf · Client-server architecture and the Web Laura Farinetti Dipartimento

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

Page 19: Client-server architecture and the Web - polito.itelite.polito.it/.../02NPYPD/2013-2014/lucidi/moduloA/02-ArchWeb.pdf · Client-server architecture and the Web Laura Farinetti Dipartimento

Web technologies and languages

19

HTML + CSS (static pages only)

+ JavaScript

PHP

MySQL

EasyPHP

Page 20: Client-server architecture and the Web - polito.itelite.polito.it/.../02NPYPD/2013-2014/lucidi/moduloA/02-ArchWeb.pdf · Client-server architecture and the Web Laura Farinetti Dipartimento

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