Web Transactions

31
08/10/09 Web Transactions 1 Web-based Transactions Fulvio Corno

description

Architectures of web applications: types of transactions (static, dynamic, database-driven, ajax).

Transcript of Web Transactions

Page 1: Web Transactions

08/10/09 Web Transactions 1

Web-based Transactions

Fulvio Corno

Page 2: Web Transactions

08/10/09 Web Transactions 2

Evolution

The world wide web, if we analyze the involved technologies, evolved through 3 main phases:1.Static and informative Web2.Dynamic and interactive Web3.Integrated and application-oriented Web

E-commerce and e-business are a particular application domain of Phase 3.

Page 3: Web Transactions

08/10/09 Web Transactions 3

Summary

Static Transactions Dynamic Transactions Database-driven Transactions Rich-Client Asynchronous Transactions

Page 4: Web Transactions

08/10/09 Web Transactions 4

Static web transaction

Client

Web server

Internet

URL http request

HTMLfiles

http responsedisplaypage

TCP/IP

path

browser server file system

HTMLsend

Page 5: Web Transactions

08/10/09 Web Transactions 5

Adopted standards URL (uniform resource locator) for finding

web pages HTML (hyper text markup language) for

writing web pages GIF (graphics interchange format) for

images HTTP (hyper text transfer protocol) for

client-server interaction TCP/IP (transmission control protocol over

internet protocol) for data transfer

Page 6: Web Transactions

08/10/09 Web Transactions 6

URL

http://elite.polito.it/~corno/index.html

DNS

130.192.5.26

TCP

Contact server

File system

URI Rewriting

HTML file contents

/home/corno/public_html/index.html

RFC 2396http://www.w3.org/Addressing/

Page 7: Web Transactions

08/10/09 Web Transactions 7

HTTP protocol

GET /~corno/index.html HTTP/1.0Accept: text/htmlAccept: image/gifUser-Agent: CornoSoft SuperBrowser 9.45

HTTP/1.0 200 OKDate: Monday, 01-Jan-2001 00:00:00 GMTServer: Apache 1.3.0MIME-Version: 1.0Last-Modified: 31-Dec-2000Content-type: text/htmlContent-lemgth: 3021

<HTML> . . .

RFC 2616, RFC 2617http://www.w3.org/Protocols

Page 8: Web Transactions

08/10/09 Web Transactions 8

Static web transaction

Browser

Webserver

Diskaccess

t0

t1

t2

t3

t4

t6

t7

t8

t9

t5

t’0

t’1

total response time

server response time user think timenetwork transfer time

Page 9: Web Transactions

08/10/09 Web Transactions 9

Response time

Browser elaboration time (t0-t1): power uf the users’ computer

Transmission time for http request (t1-t2): latency of Internet connection

Browser

Server

Disk

t0

t1

t2

Page 10: Web Transactions

08/10/09 Web Transactions 10

Response time

Server elaboration time (t2-t3, t6-t7): power of the server and number of simultaneous accesses

Disk access time (t3-t6): I/O architecture del server and number of simultaneous accesses

Browser

Server

Disk

t0

t1

t2

t3

t4

t6

t7

t5

Page 11: Web Transactions

08/10/09 Web Transactions 11

Response time

Transmission time for the HTML page (t7-t8): size of the page and of the images, latency, available bandwidth

Visualization time of the page (t8-t9): power of the users’ computer and complexity of the page

Browser

Server

Disk

t0

t1

t2

t3

t4

t6

t7

t8

t9

t5

Page 12: Web Transactions

08/10/09 Web Transactions 12

Examples

www.w3c.org

Page 13: Web Transactions

08/10/09 Web Transactions 13

Summary

Static Transactions Dynamic Transactions Database-driven Transactions Rich-Client Asynchronous Transactions

Page 14: Web Transactions

08/10/09 Web Transactions 14

Dynamic web transaction

Client

Web server

Internet

URL http request& POST data

http responsedisplaypage

TCP/IP

com-mand

browser server application

HTMLsend

Application

para-meters

logic

Page 15: Web Transactions

08/10/09 Web Transactions 15

Adopted standards

HTTP-POST for sending user-specified data CGI (common gateway interface), ISAPI

(internet information server application programming interface), server-side script, java servlet for integrating application logic into web servers

ASP (active server pages), PHP, PERL as new languages for application development

Page 16: Web Transactions

08/10/09 Web Transactions 16

URL (HTTP GET)

http://www.cad.polito.it/pap/pap.pl?author=Corno

CPU

Application

HTML

Parameters

DiskLibraries

Page 17: Web Transactions

08/10/09 Web Transactions 17

Dynamic web transaction

Browser

Webserver

Applicationserver

t0

t1

t2

t3

t5

t6

t7

t8

t9

t4

total response time

application timetotal server time

t’0

t’1

Page 18: Web Transactions

08/10/09 Web Transactions 18

Response time

Communication time between web server and application server (t3-t4, t5-t6): speed of the local network

Execution time of the application (t3-t6): server power, number of accessese, complexity of the application

Browser

Web

Application

t0

t1

t2

t3

t5

t6

t7

t8

t9

t4

Page 19: Web Transactions

08/10/09 Web Transactions 19

Examples

www.sun.com www.lastampa.it www.altavista.com

Page 20: Web Transactions

08/10/09 Web Transactions 20

Summary

Static Transactions Dynamic Transactions Database-driven Transactions Rich-Client Asynchronous Transactions

Page 21: Web Transactions

08/10/09 Web Transactions 21

Database-driven transactions

Client

Web server

Internet

URL http& POST

httpdisplaypage

TCP/IP

com-mand

browser server application

HTMLsend

Application

para-meters

database

data

Database

query

Page 22: Web Transactions

08/10/09 Web Transactions 22

Adopted standards

Cookies for storing the state of a session Java, JavaScript, ActiveX, Flash to program

the user interface on the browser SQL (structured query language), ODBC

(open database connectivity) to access data bases

Page 23: Web Transactions

08/10/09 Web Transactions 23

URL (HTTP GET)

http://www.cad.polito.it/pap/pap.pl?author=Corno

CPU

Application

HTML

Parameters

DiskLibraries

Database

Page 24: Web Transactions

08/10/09 Web Transactions 24

Database-driven transaction

Browser

Webserver

Applicationserver

Databaseserver

t0

t1

t2

t3

t5

t6

t7

t8

t9

t4

t’0

t’1

total response time

application timetotal server time

database time

Page 25: Web Transactions

08/10/09 Web Transactions 25

Response time

Application: server power, number of accesses, complexity of application

Database: number of queries, complexity of queries, size of the database

Communications: local network

Browser

WebApplication

t0

t1

t2

t3

t5

t6

t7

t8

t9

t4

t’0t’1

Database

Page 26: Web Transactions

08/10/09 Web Transactions 26

Examples

www.amazon.com

Page 27: Web Transactions

08/10/09 Web Transactions 27

Summary

Static Transactions Dynamic Transactions Database-driven Transactions Rich-Client Asynchronous Transactions

Page 28: Web Transactions

08/10/09 eBWA-www2eB 28

Web 2.0

Web applications support social interaction models

Peer exchange and user-contributed content instead of rigid publisher/reader pattern Online communities

Rich, dynamic, interactive user interfaces Integration of contents across web sites

(mashups)

Page 29: Web Transactions

08/10/09 Web Transactions 29

Rich-Client Asynchronous Transactions

Client

Web serverInternet

URL http& POST

httpdisplaypage

TCP/IP

com-mand

browser server application

HTMLsend

Application

para-meters

database

data

Database

query

Client-sideApplication

runtimeevents

DOM

http

XML/JSON

Page 30: Web Transactions

08/10/09 Web Transactions 30

Adopted standards

Dynamic HTML: DOM, Javascript, CSS JavaScript, Flash to handle a runtime

environment on the browser DOM (XHTML Document Object Model) to allow

on-the fly modification of the web page CSS 2.1 to modify attribute and handle objects

AJAX: Asynchronous Javascript and XML XMLHttpRequest for asynchronous

communication to the server Data transfer formats: JSON, XML, RDF, RSS,

Atom, FOAF, ... Mash-up technology

Page 31: Web Transactions

08/10/09 Web Transactions 31

Rich-client transaction

Browser

Webserver

Applicationserver

Databaseserver

t9t0

t1

t2

t3

t5

t6

t7

t8

t4

t’0

t’1

Runtime