copyright © 2003 t. trappenberg overview d 1 d. distributed computing module 1 technology: gr01e -...

24
Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Upload: noel-preston

Post on 30-Dec-2015

216 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 1

D. Distributed Computing

Module 1 Technology:

GR01E - Electronic Commerce Overview

Page 2: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 2

The Sydney Olympic game system: see text page 29-30

Why distributed systems: Benefits & Challenges

Divide-and-conquer

Interacting autonomous systems

Transactions

Concurrencies

Page 3: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 3

A three-tier architecture

What is middleware?

Page 4: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 4

Open systems, standards, protocols

Distributed objects technology:

e.g. CORBA (multi-language technology) RMI (Java-based technology) etc

How to get it work

Message passing

Page 5: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 5

Clients and Servers

Servers: File server, Database server, Web server, print server, object server

The new hype: peer-to-peer

Not mainframe-terminal, not necessarily big vs. small (rather specialized)

Page 6: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 6

Database servers

Relational database: series of tables that can contain links

Functions of a database server:• To interpret SQL statements • To optimize queries• To prevent the errors from concurrent access • To ensure internal consistency (referential integrity)• To detect and act upon deadlock• To administer security • To administer backup and recovery.

A distributed database is one whose tables are distributed among a number of networked computers

downloading, data replication, fragmentation

Page 7: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 7

Example:

SELECT BookId, Title, Borrowings.BorrowerName FROM Borrowings, Privileged WHERE Borrowings.BorrowerName = Privileged.BorrowerName

SQL (Structured Query Language)

Most common database access language often embedded within another language such as C++ or Java. There are several dialects such as ANSI/ISO SQL, IBM DB2, Ingres variant, a Microsoft SQL server variant and an Oracle variant.

Commit, rollback, locks …

Page 8: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 8

The history of SQL and relational databasesSQL was based on ideas propounded in the early 1970s from the ideas of the research scientist Ted Codd at the IBM San José Research Laboratories. It was originally developed in order to provide a semi-natural language interface to the IBM relational database system. Originally relational databases had a number of competitors which were much more efficient in terms of performance, for example database management systems which were based on a network model of data. However, more and more efficient implementations emerged in the late 1980s and this has lead to the situation where relational databases and SQL now dominate the software industry.

D. Ince, Developing Distributed and E-commerce Applications, Addison Wesley 2002

Page 9: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 9

Web Servers

How Web servers workWeb pages: HTML

Page 10: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 10

Static pages, dynamic pages, … web services

Server side programs:

Forms, CGI, Perl, ASP, Servlets (memory resident), …

Client side programs:

Java applets, JavaScript, VBScript, …

HTML (see text page 111-113)

Page 11: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 11

<HTML><HEAD><TITLE> Links Page </TITLE></HEAD><BODY><H1> Darrel Ince's links </H1>You really ought to look at these sites:<UL>    <LI> <A HREF = "http://www.WelshRugby.com/home">        The home of Welsh rugby </A> </LI>    <LI> <A HREF = "http://www.open.ac.uk/staff/Darrel">        My home page</A></LI>  <LI> <A HREF = "http://www.open.ac.uk/Faculty/Computing">                   My department's page</A></LI></UL></BODY></HTML>

Page 12: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 12

Person Computer

Goals

Execute

Evaluate

Read/Scan

Output

Process

Web design and usability

Page 13: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 13

http://www.cs.dal.ca/~jamie/course/CS/4173/Resources/#UI

http://www.usability.gov/guidelines/

Jamie Blustein’ resources:

… for example:

Page 14: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 14

Server side programs: Servlets

Forms, CGI, Perl, ASP, Servlets (memory resident), …

HTML GET and POST

Page 15: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 15

•They are portable across a wide variety of servers. •Since servlets are written in Java they can access a huge variety of Java features including CORBA, RMI, Java security facilities and database connectivity facilities. •Servlets are resident in memory. With CGI programming in languages such as Perl every time a request comes in from a Web browser a new process has to be spawned and terminated when the connection ends. This means that there can be quite a heavy overhead on the Web server when it loads and unloads programs. •Since servlets are Java-based they will contain all the security and safety features that are built into the language. •Servlets can maintain state across requests, something that in the early days of the World Wide Web proved difficult. This means that a servlet can remember data and details from a previous request. •The object-oriented model within Java is a much cleaner model than is found with languages such as C and Perl. When you look at Perl CGI programs you often see huge, monolithic, difficult-to-understand programs. The object-oriented nature of Java also provides the potential for greater reuse. •Servlets, because they integrate well with the security technology associated with Java can be configured to be highly secure.

Page 16: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 16

Client side programs:

Java applets, JavaScript, VBScript, …

<SCRIPT LANGUAGE = "JavaScript">document.writeln( "<H3> Hello there");</SCRIPT>

<OBJECT code = "java:name" WIDTH = n HEIGHT = n></OBJECT>

Examples:

Java applet:

JavaScript:

Page 17: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 17

XML: eXtensible Markup Language

What is XML? markup language, language to define languages

Page 18: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 18

<PRODUCT Postage = “Heavy”><PRODUCTNAME> CoatBlue</PRODUCTNAME><PRODUCTPRICE> 34000</PRODUCTPRICE>..</PRODUCT>

tag

attribute

Page 19: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 19

<?xml version = "1.0" encoding ="UTF-8"?><!DOCTYPE ENTRY[<!ELEMENT ENTRY ENTRYPAIR*><!ELEMENT ENTRYPAIR (NAME, DEFINITION)><!ELEMENT NAME (#PCDATA)><!ELEMENT DEFINITION (#PCDATA)><]>

Document type definition: language definition

Example: <ENTRY>     <ENTRYPAIR>        <NAME>Dodo</NAME>       <DEFINITION> A dead bird</DEFINITION> </ENTRYPAIR>

 <ENTRYPAIR>        <NAME>Blackbird</NAME>        <DEFINITION> A thieving bird</DEFINITION>    </ENTRYPAIR> </ENTRY>

Page 20: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 20

XML browsers

XML parsers

XML API

Processing XML documents:

Page 21: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 21

SGML: General Markup Language

FSML: Financial Services Markup Language

SVG: Scalable Vector Graphics (www consortium)

MathML

XHTML: proposed successor of HTML…

Page 22: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 22

Concurrencies and Locks

Thread: chunk of code that can be executed in parallel (independent) of other chunks of code. A scheduler supervises the execution of threads.

In a distributed system we relay on independent processes, for example, we might have to wait for some requested data. In the meantime we could use the processor time other tasks that might be pending. good distributed systems are multi-threaded parallel computing: `utilization of multiple processors’

However, if a thread depends on some data that should not be modified by another thread during its processing, then we have to lock that data.

Client-servers: Write locks, read locks, … and dead locks (time limits, lock manager, …)

Database servers: Row-, page-, table-, database-locking

Page 23: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 23

Transactions Sequence of operations

ACID: Atomicity, Consistency, Isolation, Durability

Server transactions vs concurrent transactions

Transaction monitors

e.g. Sun’s Enterprise JavaBeansinterfacesclassescontainersserverstransaction monitor…

Page 24: Copyright © 2003 T. Trappenberg Overview D 1 D. Distributed Computing Module 1 Technology: GR01E - Electronic Commerce Overview

Copyright © 2003 T. Trappenberg Overview D 24

(Ro)bots, agents and spiders

Program that `travel the web’ to gather information

Static argents Mobile agents

For example, search engines, web tools such as inactive-link alert, news agents,e-mail harvesting for spamming, …