30
Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison Wesley 2005)

Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Embed Size (px)

Citation preview

Page 1: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Web Technology and DBMS’s(CB 29)

CPSC 356 Database Design

Ellen Walker

Hiram College

(Includes figures from Database Systems by Connolly & Begg, © Addison Wesley 2005)

Page 2: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

What is the Internet?

• Interconnected Networks– Interoperable via standards (TCP, IP)

• History– ARPANet (late 60’s, early 70’s) - military– NSF took over, provided funding (1986)– Commercial backbones (1996 - present)

Page 3: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Internet vs. Intranet

• Internet– Global, open, public– Called “extranet” to distinguish from Intranet

• Intranet– Private network for exclusive use of an

organization– Behind a firewall

• Typically, limited interaction

Page 4: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Internet Evolution of a Business (Cisco)

• E-mail• Web site• E-Commerce

– Customers can place and pay for orders via web

• E-Business– Complete integration of Internet technology into

business’s infrastructure

• Ecosystem– Entire business process automated - customers,

suppliers, alliance partners, corporate infrastructure merged into seamless system

Page 5: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Web vs. Internet

• Internet provides infrastructure of information transmission across the network

• Web contains interlinked information (web pages)– Servers: contain pages and transmit on

request– Clients (browsers): request and display

pages to users

Page 6: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Languages of the Web

• HTTP - protocol for sending / receiving web pages. Includes GET vs. POST

• HTML - basic markup language (represents complex pages as text). Includes mechanism (href) to reference other pages.

• XML - extended markup language - generalization of HTML to represent more complex document information

• (etc) -- this is not a complete list!

Page 7: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Limitations of HTTP

• Each transaction consists of a single request for data and a single response.– GET = request data– POST = response (or data from form)

• Protocol is “stateless” - does not retain information beteween transactions– Workarounds: cookies or hidden text

Page 8: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Static vs. Dynamic Web Page

• Static web page– Contents of page stored in a file, served as

originally written

• Dynamic web page– Generated as needed– Only instructions for generating the page

are stored (e.g. php query/display based on argument)

Page 9: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Dynamic Web Pages

• Input provided as parameters or from forms in the page

• Data generated from queries

• Pages written in a “scripting language” (PHP is one example)

Page 10: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Requirements for Web-DBMS Integration

• Ability to maintain data security• Not tied to a single DBMS• Not tied to a single browser• Availability of all features of DBMS• Open-architecture approach, supporting

multiple servers, standard interoperability languages (e.g. DCOM, CORBA, XML, SOAP)

Page 11: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Advantages of Web Approach

• Simplicity

• Platform independence

• Graphical User Interface

• Standardization

• Transparent network access

• Simplified deployment

• Global access

Page 12: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Disadvantages

• (lack of) Reliability

• (lack of) Security

• Cost (!)

• Heavy (unpredictable) loads

• HTML limitations

• Bandwidth & Performance limitations

• Immaturity of platform & tools

Page 13: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Tools to Integrate the Web

• Scripting Languages– Client-side or Server-side

• Common Gateway Interface (CGI)– Server-side

• Web server extensions• Java, J2EE, SQLJ, etc.• Microsoft .Net• Oracle’s Internet platform

Page 14: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Scripting languages

• Programs embedded in HTML files on server

• Behavior of all clients changed by changing script on server

• Scripts are generally interpreted, not compiled

Page 15: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

JavaScript

• Server-side or Client-side (client-side more common)

• Allows immediate reaction to user interface widgets

• Object-based (Document Object Model)• Limited relative to Java• (VBScript : Visual Basic = JavaScript :

Java)

Page 16: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Perl, PHP

• Server side languages

• Heavy Unix flavor (e.g. use of regular expressions)

• PHP preferred for Linux– Integrates with Apache HTTP Server– Works well with MySQL or PostgreSQL

Page 17: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Common Gateway Interface (CGI)

• Defines how scripts communicate with web servers– Uses Environment variables, standard I/O on

server side– Uses HTML Forms on client side (original impetus

for forms)

• Nearly any programming language can run on server (std. output returned to browser)

• Server runs script based on filename (x.cgi, x.php, etc) - this is configurable

Page 18: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

CGI Environment

Page 19: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Advantages of CGI

• Standardized interface

• Programming-language independent

• Web-server independence

• Simplicity

• Wide acceptance

Page 20: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Disadvantages of CGI

• Web server can be bottleneck• Problems from HTTP Statelessness

– No validation of user input (must go “back” to repopulate form)

– No transactions (must connect to database on every page)

• Security risks– Scripts with greater privileges than server– Risk of unanticipated (or malicious) user input

Page 21: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

HTTP Cookies

• Stored by browser in a file on client

• Cookies set / retrieved by HTTP request

• Issues:– Not supported by all browsers– For privacy reasons, users disable cookies

Page 22: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Non-CGI Gateways

• API Extensions to server (NSAPI, ISAPI)

• Scripts loaded as part of server – Direct interaction with back end– One copy per server, not per request– Changes server executable (risk?)

• Requires specialized programmers

Page 23: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Vendor Specific Scripting

• Developed by vendors as server add-ons– JSP - Java Server pages (Sun)– ASP - Active Server pages (Microsoft)

• Flexibility of CGI, without performance overhead and I/O limitations

• Better integration with vendor’s other web solutions

• Some compatibility limitations

Page 24: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Sun’s Java Platform

• Java language: “write once run anywhere”

• Assorted “editions”– ME (embedded)– SE (standard) - for desktop & workstation– EE (enterprise) - for multi-tier, robust,

multiuser applications

Page 25: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Java 2 Platform (1999)

Page 26: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Microsoft .NET Platform

• Integrated across servers, OS, applications, programming language environments

• OLE - Object Linking and Embedding– Shared objects that provide specific functionality

(e.g. sound clip)

• [D]COM([Distributed] Component Object Model)– Connects client application and object (binary-

compatible components)

Page 27: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

MS OLE - DB

Page 28: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

.NET Framework

Page 29: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Oracle’s Approach

• Aimed at distributed environments• N-tier architecture, based on industry

standards• Designed for e-business • Components include:

– TopLink (relate Java objects to relational databases)

– Portal (entry point for web access)– Business Intelligence (Reports, Discoverer, etc)

Page 30: Web Technology and DBMS’s (CB 29) CPSC 356 Database Design Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison

Oracle Internet Platform