Web Technology & DBMSs

61 slides
0.38 MB

Similar Presentations

Presentation Transcript


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


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


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.


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


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


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;


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)


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)


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


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


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


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


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


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


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


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


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


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)


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


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


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


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


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


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)


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)


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