35
Distributed systems: Distributed systems: a a n architectural view n architectural view

Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

Embed Size (px)

Citation preview

Page 1: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

Distributed systems:Distributed systems:aan architectural viewn architectural view

Page 2: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

Once upon a time…Once upon a time…

The

Mainframe

DumbTerminal

DumbTerminal

DumbTerminal

DumbTerminal

DumbTerminal

DumbTerminal

All of the work is done at the center

Fixed local connectionsOr modems

Page 3: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

Mainframe

Mainframe Terminal

logic/datapresentation User input/output

Page 4: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

Once upon a time…Once upon a time…

The

Mainframe

IntelligentTerminal

IntelligentTerminal

IntelligentTerminal

IntelligentTerminal

IntelligentTerminal

IntelligentTerminal

Some work os done on the periphery: the client-server paradigm

Page 5: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

Client server

Server Client

Most logic/data Some logic/data + presentation

Enabled by:• the Personal Computer / Workstation• the Internet (TCP/IP)

Page 6: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

Client server - evolution

Three tier architecture

DataStorage

BusinessLogic

PresentationLogic

The Model The Controller

The View

Page 7: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

Client server - problems

Part of the BUSINESS LOGIC is performed on the periphery:

The new version nightmare…

Page 8: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

The Web – Back to the old model!

Web Server 2 Thin client

General purpose

Web Server 3

Web Server 1

Page 9: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

The Web:The Web:aan architectural viewn architectural view

Page 10: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

Needed Conceps:

TCP-IP protocol suite

Port

Page 11: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

HTTP Overview HTTP RequestsAn HTTP request consists of a request method, (“subprotocol” specification)a request URL, (location)header fields, (metadata)a body. (data)

HTTP 1.1 defines the following request methods:• GET: Retrieves the resource identified by the request URL• HEAD: Returns the headers identified by the request URL• POST: Sends data of unlimited length to the Web server• PUT: Stores a resource under the request URL• DELETE: Removes the resource identified by the request URL• OPTIONS: Returns the HTTP methods the server supports• TRACE: Returns the header fields sent with the TRACE request

HTTP 1.0 includes only the GET, HEAD, and POST methods. Although J2EE servers are required to support only HTTP 1.0, in practice many servers support HTTP 1.1.

Page 12: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

HTTP Overview HTTP ResponsesAn HTTP response contains a result code, header fields, and a body.The HTTP protocol expects the result code and all header fields to be returned before any body content.

Some commonly used status codes include:

• 100: Continue• 200: OK

• 404: the requested resource is not available• 401: the request requires HTTP authentication• 500: an error occurred inside the HTTP server that prevented it from fulfilling the request• 503: the HTTP server is temporarily overloaded and unable to handle the request

For detailed information on this protocol, see the Internet RFCs: HTTP/1.0 (RFC 1945), HTTP/1.1 (RFC 2616). (http://www.rfc-editor.org/rfc.html)

See also http://en.wikipedia.org/wiki/Http

Page 13: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

HTTPS Overview https is a URI scheme which is syntactically identical to the http: scheme normally used for accessing resources using HTTP. Using an https: URL indicates that HTTP is to be used, but with a different default port (443) and an additional encryption/authentication layer between HTTP and TCP.

This system was developed by Netscape Communications Corporation to provide authentication and encrypted communication and is widely used on the World Wide Web for security-sensitive communication, such as payment transactions.

Page 14: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

S-HTTP Overview Secure hypertext transfer protocol' (S-HTTP) is an alternative mechanism to the https URI scheme for encrypting web communications carried over HTTP. S-HTTP is defined in RFC 2660.

Web browsers typically use HTTP to communicate with web servers, sending and receiving information without encrypting it. For sensitive transactions, such as Internet e-commerce or online access to financial accounts, the browser and server must encrypt this information.

The https: URI scheme and S-HTTP were both defined in the mid 1990s to address this need. Netscape and Microsoft supported HTTPS rather than S-HTTP, leading to HTTPS becoming the de facto standard mechanism for securing web communications. S-HTTP is an alternative mechanism that is not widely used.

Page 15: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

•Browser

•Render HTML

•Get URL

•Send HTML

•Get HTML file

•HTTPD

FileSystem

The primitive Web modelThe primitive Web model

Page 16: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

http

d

The primitive Web model

Inte

rnet

HTTP Get

Client

Browser

Server

File System

Page 17: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

•Browser

•Render HTML

•Get URL with Params

•Send HTML

•Execute CGI(params)

•Build HTML on the fly

•HTTPD •CGI Process

A simple interactive Web modelA simple interactive Web model

Page 18: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

http

d

A simple interactive Web model

Inte

rnet

HTTP Get

Cgi-bin

proc

ess

Client

Browser

Server

File System

Page 19: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

•Browser

•Render HTML

•Get URL with Params

•Send HTML

•Execute CGI(params)

•Build HTML on the fly

•HTTPD •CGI Process •DB

•Run Sql query

•Send query results

An evolved interactive Web modelAn evolved interactive Web model

Page 20: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

http

d

An evolved interactive Web model

Inte

rnet

HTTP Get

Cgi-bin Query SQL

proc

ess

DB

Data

Client

Browser

Server

File System

Page 21: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

http

d

The Bottlenecks

Inte

rnet

HTTP Get

Cgi-bin Query SQL

proc

ess

DB

Data

Client

Browser SLOW!

SLOW!

Server

File System

Page 22: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

http

d

The Bottleneck – part I

Inte

rnet

HTTP Get

Cgi-bin Query SQL

proc

ess

DB

Data

Client

Browser SLOW!

Server

File System

Page 23: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

http

d

The solution:

Inte

rnet

HTTP Get

Cgi-bin Query SQL

proc

ess

DB

Data

Client

Smartbrowser

How? How? Including code in HTMLIncluding code in HTML

Server

File System

reduce net traffic by having a smarter client!

Page 24: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

Programming languagesProgramming languages

• JavaJava

Enabling technologies

Client

Smartbrowser

Scripting languagesScripting languages• JavascriptJavascript• VbscriptVbscript• PerlscriptPerlscript• PythonPython• … …

Interpreted:

Source code travels

Compiled:

Executable travels

(must be

HW-OS-Browser

independent!)

Page 25: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

http

d

The Bottleneck – part II

Inte

rnet

HTTP Get

Cgi-bin Query SQL

proc

ess

DB

Data

Client

BrowserSLOW!

Server

File System

Page 26: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

http

d

The solution:

Inte

rnet

HTTP Get

Query SQL

Function

DB

Data

Client

Browser

Server

File System

integrate the service into the httpd process

Page 27: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

Enabling technologies

• MultithreadingMultithreading• DLLDLL• ServletsServlets

Using…Using…

•Scripting languagesScripting languages•Programming languagesProgramming languages

Function

http

dServer

How? How? Including code in HTMLIncluding code in HTML

File System

(depending on server implementation)

Page 28: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

mixed client- and server-side scripting

<HTML><HTML>……<SCRIPT LANGUAGE=VBScript RUNAT=SERVER><SCRIPT LANGUAGE=VBScript RUNAT=SERVER>……VBScript Commands…VBScript Commands…</SCRIPT></SCRIPT>……<%VBScript Commands%><%VBScript Commands%>……<SCRIPT LANGUAGE=JavaScript><SCRIPT LANGUAGE=JavaScript>……JavaScript Commands…JavaScript Commands…</SCRIPT></SCRIPT>……</HTML></HTML>

Code executed Code executed by the Server by the Server BEFORE the BEFORE the page is page is transferred transferred over the Netover the Net

Code transferred to the clientCode transferred to the clientand interpreted by the Browserand interpreted by the Browser

ASP SyntaxASP Syntax

Page 29: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

The state problem

Inte

rnet

Client

1

Server

+CGI

http

d

Data User 1

Data User 2

Data User 3

Client

3

Client

2

??

Page 30: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

A typical solution

Inte

rnet

Client

1

Server

+CGI

http

d

Data User 1

Data User 2

Data User 3

Client

3

Client

2

CookieCookie

CookieCookie

CookieCookie

Supported

by Java & JavaScript

Page 31: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

http

d

A more radical solution

Inte

rnet

HTTP GetCgi-bin

proc

ess

Client

Browser

Server

Java

ap

plet proc

ess

Startup

Sta

rtup

Socket connection

Supported

by Java

Page 32: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

http

d

An even more radical solution

Inte

rnet

HTTP GetCgi-bin

proc

ess

Client

Browser

Server

Java

ap

plet proc

ess

Startup

Sta

rtup

CORBAMiddle Tier

Supported

by Java

Page 33: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

WAP - Cenni

Client Client (cellular phone)(cellular phone)MicroBrowserMicroBrowser

Gateway WAPGateway WAPRequest WDP + WTSL

(Wireless Datagram Protocol)Wireless Transport Security Layer

Server HTTPServer HTTPPage description:

Wml (Wireless Markup Language, in XML)Hdml (HandhelD Markup Language, variante di HTML

9600 baud (*)

(*) GPRS up to 56 Kbit/sec, UMTS up to 2 Mbit/sec (Universal Mobile Telecommunication System)

More info: www.wapforum.org

Page 34: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

XML Enabled HTTP Server

Client Client DocumentDocument

Server Server HTTPHTTPServer Server

XSLTXSLTProcessor Processor

HTTP request

StylesheetStylesheetServer Server

Get document

XML document Get SS

XSL stylesheet

XML + XSL

HTML documentHTML

document

Page 35: Distributed systems: an architectural view. Once upon a time… The Mainframe Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb Terminal Dumb

http

d

The Proxy

Inte

rnet

Client

Browser

Server

Proxy