Web Technology & DBMSs

61 slides
0.38 MB
1034 views

Similar Presentations

Presentation Transcript

1

Web Technology & DBMSsInstructor: Dr. Lee cs157B, fall 2003 by: Anupam GargChapter 28

2

OverviewSimple Web Pages HTTP HTML Web Application Architectures Dynamic Web Pages Scripting CGI Server Extensions (APIs) Java: Servlets, JSP, JDBC Microsoft: ASP, ADO, ODBC Enterprise Solutions Oracle Internet Application Server

3

History of the InternetDeveloped in 60s and 70s by US Department of Defense called ARPANET (Advanced Research Projects Agency NETwork) project to build a network that could withstand physical attacks 1982: TCP/IP adopted as ARPANET standard protocol 1986: project shifted from military to government/universities by grant money from National Science Foundation renamed NSFNET (National Science Foundation NETwork) 1995: NSFNET ceased control of network backbone; network becomes known as Internet.

4

Intranet vs. ExtranetIntranet : a web site or group of sites belonging to an organization, accessible only by the members of the organization (behind firewall) Extranet : an intranet that is partially accessible to authorized outsiders

5

HTTP (HyperText Transfer Protocol)The protocol used to transfer Web pages through the Internet. Version history: HTTP/0.9: early development of the web HTTP/1.0: released in 1995 HTTP/1.1: current version

6

HTTP (continued)Based on a “request-response” paradigm: connection – the client establishes a connection with the web server request – the client sends a request message to the web server response – the web server sends a response to the client close – the connection is closed by the web server NOTE: HTTP is inherently a “stateless” protocol;

7

MIME typesMultipurpose Internet Mail Extensions used by HTTP header to determine how to handle multiple media types Example: text/html (html document; *.html) application/java (java class file; *.class)

8

HTTP RequestHTTP header indicating: type of request GET: gets the requested resource POST: transfer posted data to the specified resource HEAD: similar to get but returns the HTTP header ONLY PUT (HTTP/1.1): uploads the resource to the server DELETE (HTTP/1.1): deletes the resource from the server OPTIONS (HTTP/1.1):request’s the server’s configuration options name of a resource HTTP version body (*optional)

9

HTTP ResponseHTTP header indicating: HTTP version status of the response information to control the response behavior body (*optional)

10

Static vs. Dynamic Web Pagesstatic: content stored in an html page content does not update unless the file is updated dynamic: content is generated “on the fly” content is gathered and delivered based on the user’s request; usually content here is stored in a database

11

two-tier client-server architecture Web-DBMS Architecture Client (tier 1) : primarily responsible for presentation of data to the user user interface actions main business application logic Server (tier 2) : primarily responsible for supplying data services to the client limited business application logic (i.e. verification not able to be processed by the client) access to the requested data

12

two-tier architecture (continued) Web-DBMS Architecture tier 1 User interface Main business and data processing logictier 2 Server-side validation Database access

13

three-tier architecture Web-DBMS Architecture Client (tier 1) : primarily responsible for presentation of data to the user Application Server (tier 2) : primarily responsible for supplying data processing and business logic Database Server (tier 3) : responsible for data validation and database access

14

three-tier architecture (continued) Web-DBMS Architecture Tier 1 user interfaceTier 3 data validation database accessTier 2 business logic data processing logic

15

two-tier vs. three-tier Web-DBMS Architecture 2 tier A ‘fat’ client, requiring considerable resources on the client’s computer to run effectively. This includes RAM, disk space, and CPU power. A significant client-side administration overhead. 3 tier Less expensive because client is ‘thin’ Maintenance is centralized Centralized business logic makes deployment easier Added modularity allows modifications to any tier without affecting others Load balancing is easier with separation of servers

16

n-tier architecture Web-DBMS Architecture Done by extending 3-tier’s middle tier into any # of tiers Is more modular, therefore changes can be more independent Load balancing is better because of distribution of work

17

Web-DBMS AdvantagesSimplicity (minor) Platform Independence GUI Standardization (minor) Cross-Platform Support (minor) Transparent Network Access Scalable Deployment Innovation

18

Web-DBMS DisadvantagesReliability (minor) Security Cost – commercial web site ~ $300K-$3.4mil Scalability Limited Functionality of HTML (minor) Statelessness (minor) Bandwidth Performance Immaturity of Development Tools (minor)

19

Integrating Web and DBMSsScripting languages – JavaScript, VBScript, Perl CGI HTTP Cookies Web Server Extensions (APIs) – NetscapeAPI, Microsoft’s IIS API Java and JDBC, SQLJ, Servlets, JSP ASP and ActiveX Data Objects (ADO) Oracle’s Internet Platform

20

Scripting LanguagesScripts are embedded in HTML Some can generate HTML ‘on-the-fly’ Interpreted, NOT compiled Examples: JavaScript, VBScript, Perl & PHP

21

JavaScriptObject-based scripting language Relatively simple Data Types: numeric, String, and boolean values Syntax similar to Java No API functions that interact with the filesystem JavaScript IS NOT Java

22

JavaScript vs. JavaJavaScript Code sent to client; Interpreted by client (browser) Object-based. Built in, extensible objects, but no class inheritance Code embedded in HTML Loose typing (variable data types not declared) Dynamic binding. Object references checked at runtime. Cannot automatically write to hard diskJava Compiled on server before execution on client Object-oriented. Object classes with inheritance. Code distinct from HTML Strong Typing (variable data types must be declared) Static binding. Object references must exist at compile time Cannot automatically write to hard disk

23

VBScriptVirtually identical to JavaScript Syntax similar to Visual Basic instead of Java No API functions that interact with the file system Client side scripts – Mac, *nix, Netscape do not handle VBScript (Internet Explorer alone) Server side – mostly used with ASP

24

Perl & PHPPerl combines features of C and Unix utilities The most widely used languages for server-side programming Founded on Unix, but now cross-platform PHP is HTML embedded Perl scripting language Very popular – Apache HTTP Server, PHP, and mySQL or PostgreSQL (very simple and quick)

25

Common Gateway Interface (CGI)CGI : A specification for transferring information between a Web server and a CGI program Program accepts information from STDIN and outputs to STDOUT (web server) Output must also first send MIME header Since it is a specification, any language can be used; Perl, however, is by far the most common Using a CGI script is transparent to the user (web browser)

26

CGI (continued)Steps in CGI script execution: 1: user initiates the CGI script 2. browser contacts server asking for permission to use script 3. server checks user permission and that script exists 4. server prepares ENV variables and launches script 5. script executes and reads ENV and STDIN 6. script sends MIME header and contents to STDOUT 7. server sends data in STDOUT to browser and closes connection 8. browser displays information

Browse More Presentations

Last Updated: 8th March 2018

Recommended PPTs