Connecting Databases to the Web

Slides:



Advertisements
Similar presentations
Lecture plan Information retrieval (from week 11)
Advertisements

1 Database Driven Web Application Clients Application Servers including web servers Database Server Traditional client-server (2-tier architecture): client:
BICS546 Client/Server Database Application Development.
15 Chapter 15 Web Database Development Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
INTERNET DATABASE Chapter 9. u Basics of Internet, Web, HTTP, HTML, URLs. u Advantages and disadvantages of Web as a database platform. u Approaches for.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 2.
Week 2 IBS 685. Static Page Architecture The user requests the page by typing a URL in a browser The Browser requests the page from the Web Server The.
Introduction to Web Interface Technology (CSE2030)
Multiple Tiers in Action
The World Wide Web and the Internet Dr Jim Briggs 1WUCM1.
1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
Introduction to Web Interface Technology (CSE2030)
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
Java Server Team 8. Overview What is a Java Server? History Architecture Advantages Disadvantages Current Technologies Conclusion.
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
Web-Enabling the Warehouse Chapter 16. Benefits of Web-Enabling a Data Warehouse Better-informed decision making Lower costs of deployment and management.
Apache Jakarta Tomcat Suh, Junho. Road Map Tomcat Overview Tomcat Overview History History What is Tomcat? What is Tomcat? Servlet Container.
Java Server Programming Jeff Schmitt Towson University October 15, 1998.
WHAT IS PHP PHP is an HTML-embedded scripting language primarily used for dynamic Web applications.
Web-based Software Development - An introduction.
Server-side Technologies
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
Applets & Servlets.
1 Connecting Databases to the Web October 30 th, 2001 Xinguang Sheng Marcus Haebler.
Web Application Development Tools/Environments Tim Sigmon George Pipkin, Bill Niebel, Wade Komisar Dave Saunders, Nathan Piazza Advanced Technology Group.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.

Week 7 Lecture Web Database Development Samuel Conn, Asst. Professor
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Introduction to ColdFusion Penn State Web 2001 Conference Brian Panulla Elmwood Media Group, LLC.
Modern Software Technologies Java™, J2EE™, JSP™, JDBC™ by Radoslav Tr. Ivanov
Web Application Programming Carol Wolf Computer Science.
COLD FUSION Deepak Sethi. What is it…. Cold fusion is a complete web application server mainly used for developing e-business applications. It allows.
Fundamentals of Database Chapter 7 Database Technologies.
(Macromedia) Cold Fusion: A Brief Overview  What is Cold Fusion?  An example of CF code  How does it compare with the others: - PHP - ASP - CGI/Perl.
Putting it all together Dynamic Data Base Access Norman White Stern School of Business.
2-1 WEB DATABSE INTERFACING Colorado Technical University IT420.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
1 CS122B: Projects in Databases and Web Applications Spring 2015 Notes 03: Web-App Architectures Professor Chen Li Department of Computer Science CS122B.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 14 Database Connectivity and Web Technologies.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
Introduction and Principles Web Server Scripting.
WEB SERVER SOFTWARE FEATURE SETS
Database Connectivity and Server-Side Scripting Chapter 12.
1 Connecting Databases to the Web January 31 th, 2000 Seree Chinodom.
Web Page Designing With Dreamweaver MX\Session 1\1 of 9 Session 1 Introduction to PHP Hypertext Preprocessor - PHP.
Connecting Databases to the Web
Java Server Pages Can web pages be created specially for each user?
CS122B: Projects in Databases and Web Applications Spring 2017
CS122B: Projects in Databases and Web Applications Winter 2017
Web-based Software Development - An introduction
Introduction Servlets and JSP
Section 6.3 Server-side Scripting
Connecting Databases to the Web
Netscape Application Server
Web Technology and DBMSs
Introduction and Principles
CF101: Welcome to ColdFusion
PHP / MySQL Introduction
Web Technology and DBMSs
Web Development Using ASP .NET
CS122B: Projects in Databases and Web Applications Winter 2018
Lecture 1: Multi-tier Architecture Overview
CS122B: Projects in Databases and Web Applications Spring 2018
Server-Side Processing II
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
CS-422 Enterprise Computing Preview. Client Server Strategies CGI (Common Gateway Interface) Active Server Pages –Personal Home Pages (PHP) –MS Active.
Presentation transcript:

Connecting Databases to the Web November 3rd, 1999 Marcus Haebler

Connecting Databases to the Web How the Web Works The old fashioned way: Web-Browser Web-Server HTTP-Request GET ... HTML-File File-System Load File November 3, 1999 Connecting Databases to the Web

Connecting Databases to the Web How the Web Works All pages are static Need to generate web pages on the fly depending on user input ? November 3, 1999 Connecting Databases to the Web

Common Gateway Interface (CGI) Some files on server are interpreted as programs depending on either ext., flag or special directory Program is invoked and generates MIME header and HTML on stdout Web-Server Web-Server File-System HTTP-Request Load File HTML HTML? HTML-File Execute Program Program? Output File I/O, Network, DB November 3, 1999 Connecting Databases to the Web

Connecting Databases to the Web CGI: Discussion Advantages: Standardized: works for every web-server, browser Flexible: Any language (C++, Perl, Java, …) can be used Disadvantages: Statelessness: query-by-query approach Inefficient: new process for every request Security: CGI programmer is responsible for security Updates: To update layout, one has to be a programmer November 3, 1999 Connecting Databases to the Web

Java Applets Web-Server Web-Server Server-Process HTTP-Request Load File File-System HTML-File File Load Applet... Java-Class Requests Java-Classes Execute Applet... Java Virtual Machine (JVM) Server-Process November 3, 1999 Connecting Databases to the Web

Java Applets: Discussion Advantages: Platform independent: works for every web-server and browser supporting Java Disadvantages: Standalone Character: Entire session runs inside applet HTML forms are not used Inefficient: loading can take a long time ... Resource intensive: Client needs to be state of the art Restrictive: can only connect to server where applet was loaded from (restrictions of Java VM) Note: Server-Process can be written in any language November 3, 1999 Connecting Databases to the Web

Connecting Databases to the Web DB Access in Java Java Applet TCP/UDP IP Java-Server-Process JDBC Driver manager JDBC-Driver JDBC-Driver JDBC-Driver Sybase Oracle ... November 3, 1999 Connecting Databases to the Web

Connecting Databases to the Web Server Extensions Previous Approaches Platform independent and standardized Simple interface Lots of programming necessary Inefficient Server Extensions Server is extended with handler/module One handler for all incoming requests Much more efficient November 3, 1999 Connecting Databases to the Web

Server Extensions: The Basic Idea Web-Server Web-Server HTTP-Request File-System Load File HTML HTML? HTML-File File Script? Output Server Extension I/O, Network, DB November 3, 1999 Connecting Databases to the Web

Connecting Databases to the Web Server Extensions API depends on Server vendor: Apache Foundation Apache Server: Apache API Microsoft Internet Information Server: ISAPI Netscape Enterprise Server: NSAPI One can define it’s own server extension, e.g. Authentication module Counter module November 3, 1999 Connecting Databases to the Web

A Quick Look at Market Shares Market Share for Top Servers Across All Domains August 1995 - October 1999 Source: http://www.netcraft.com/survey/ November 3, 1999 Connecting Databases to the Web

ColdFusion Web-Server Web-Server HTTP-Request Load File File-System HTML HTML? HTML-File File HTML ODBC-Driver Native DB Email Directories COM/CORBA CF Script? Cold Fusion Server Extension Cold Fusion Application Server November 3, 1999 Connecting Databases to the Web

ColdFusion: Simple Query Proprietary Scripting Language CFML - similar to other scripting languages <CFQUERY NAME=“PersonList” DATASOURCE=“PersonDB”> SELECT * FROM Persons </CFQUERY> <HTML> <BODY> <H1> Person List </H1> <CFOUTPUT QUERY=“PersonList”> <B>Name:</B> #Name# <B>Age:</B> #Age# <B>Salary:</B> $#Sal# <BR> </CFOUTPUT> </BODY> </HTML> <HTML> <BODY> <H1> Person List </H1> <B>Name:</B> Tom <B>Age:</B> 45 <B>Salary:</B> $45000 <BR> <B>Name:</B> Jim <B>Age:</B> 38 <B>Salary:</B> $40000 <BR> <B>Name:</B> Karen <B>Age:</B> 26 <B>Salary:</B> $32000 <BR> </BODY> </HTML> November 3, 1999 Connecting Databases to the Web

ColdFusion: Form Handling <CFQUERY NAME=“PersonInfo” DATASOURCE=“PersonDB”> SELECT * FROM Persons WHERE Name=#Form.PName# </CFQUERY> <HTML> <BODY> <CFOUTPUT QUERY=“PersonInfo”> <H1> #Name# </H1> <UL> <LI><B>Age:</B> #Age# <LI><B>Salary:</B> $#Sal# <LI><A href=“#URL#”><B>Homepage</B> </A> </UL> </CFOUTPUT> </BODY> </HTML> <HTML> <BODY> <H1> Tom </H1> <UL> <LI><B>Age:</B> 45 <LI><B>Salary:</B> $45000 <LI><A href=“www.tom.com” <B>Homepage</B></A> </UL> </BODY> </HTML> <HTML> <BODY> <FORM ACTION="http://www.abc.com/cf/pf.cfm"> <H1> Find Person </H1> Person Name <INPUT NAME="PNAME"> <p> <input type="submit" value="Find"> </FORM> </BODY> </HTML> November 3, 1999 Connecting Databases to the Web

ColdFusion: Misc. Issues Siteadmin sets up data sources very similar to the handling of ODBC data sources in MS Windows In fact ColdFusion combines techniques to access databases: Generation of HTML code Java Applets embedded via <CFGRID></CFGRID> access the database through the application server Application server is also gateway to database for the ColdFusion IDE (ColdFusion Studio) November 3, 1999 Connecting Databases to the Web

Active Server Pages Active Server Pages (ASPs) Available in IIS and Personal Web Server Based on VBScript, Jscript Code in <% ... %> Modular Object Modell Active Server Components Active Data Objects for Database access File-System Web-Server HTTP-Request HTML-File Load File ASP-File HTML ASP-Script Output I/O, Network, DB Active Server Page Scripting Engine Active Server Components November 3, 1999 Connecting Databases to the Web

Connecting Databases to the Web PHP How does PHP differ from ASP and CF? Free, open source Many client libraries integrated Runs on any web server supporting CGIs (MS Windows or Unix) Module version for Apache Web-Server Web-Server File-System HTTP-Request Load File HTML HTML-File PHP-File Output PHP-Script PHP Module Database APIs, other APIs SNMP, IMAP, POP3, LDAP, ... November 3, 1999 Connecting Databases to the Web

Connecting Databases to the Web PHP: an Example <HTML> <BODY> <?PHP $db = mysql_connect("localhost", "root"); mysql_select_db("mydb",$db); $result = mysql_query("SELECT * FROM employees",$db); ?> <TABLE BORDER=1> <TR><TD>NAME</TD><TD>POSITION</TR> while ($myrow = mysql_fetch_row($result)) { printf("<tr><td>%s %s</td><td>%s</td></tr>\n", $myrow[1], $myrow[2], $myrow[3]); } </TABLE> </BODY> </HTML> November 3, 1999 Connecting Databases to the Web

Connecting Databases to the Web PHP: Misc. Issues Syntax Perl/C like Form fields are available as variables in following page has e.g. image and PDF generation on the fly some OO features (e.g. classes) Version 4 in beta test has more OO features is based on a different, faster scripting engine more modular architecture The number of functions is steadily increasing November 3, 1999 Connecting Databases to the Web

Databases Usually Used ASP MS Jet Engine (DB engine behind MS Access) MS SQL Server Oracle (ODBC) ColdFusion Oracle (native driver support) Informix (native driver support) Sybase (native driver support) PHP MySQL (linked in client library) mSQL (linked in client library) Postgres (linked in client library) Oracle (linked in client library) November 3, 1999 Connecting Databases to the Web

Connecting Databases to the Web What Else Is Out There? Oracle Application Server (formerly known as OWS) 3-tier architecture PENN ExpressApp is based on OWS Informix Web datablade Servlets for Java based web server various web shop applications all of them use a more or less sophisticated scripting language and a lot more ... November 3, 1999 Connecting Databases to the Web

Connecting Databases to the Web Architectures The architecture is the kind and number of servers involved Different architectures different advantages and disadvantages Generally we can distinguish between three different types: 2-tier architecture 3-tier architecture 4-tier architecture November 3, 1999 Connecting Databases to the Web

Connecting Databases to the Web 2-tier architecture Web server plus module connecting to database, LDAP, IMAP, ... 1 HTTP-Request HTML-File Web-Server Module 2 DB Directory Mail Server SNMP November 3, 1999 Connecting Databases to the Web

Connecting Databases to the Web 2-tier architecture Advantages: easy and fast to setup easy to administer Disadvantages: not fail safe scales badly on high loads November 3, 1999 Connecting Databases to the Web

Connecting Databases to the Web 3-tier architecture Web server plus application server connecting to database, IMAP, ... 1 Web Server [Cluster] Application Server [Cluster] 2 Other Servers [Cluster] 3 DB Repl. DB DB Mail Server SNMP November 3, 1999 Connecting Databases to the Web

Connecting Databases to the Web 3-tier architecture Advantages: better scalability more reliable through failover mechanisms offers better load balancing Disadvantages: already complicated to set up who is responsible for load balancing? November 3, 1999 Connecting Databases to the Web

Connecting Databases to the Web 4-tier architecture 1 Web Server [Cluster] Request Router Request Router Request Router 2 Application Server [Cluster] 3 Other Servers [Cluster] 4 DB Repl. DB DB Mail Server SNMP November 3, 1999 Connecting Databases to the Web

Connecting Databases to the Web 4-tier architecture Advantages: even better scalability better failover mechanisms Request routers offer better load balancing Easier to administer (number of request router usually small) Disadvantages: initial setup very complicated November 3, 1999 Connecting Databases to the Web

Connecting Databases to the Web Architectures: Usage 2-tier Apache-PHP plus Database etc. 3-tier ColdFusion 4.0x Oracle Web Application Server? 4-tier Web shops like Intershop, ... ColdFusion 4.5x? Oracle Application Server? Classification not always 100% clear November 3, 1999 Connecting Databases to the Web

Connecting Databases to the Web Security Issues Complicated architecture  More potential for glitches Protection of users from each other Web server with DB  nice way for hacker into main database ... November 3, 1999 Connecting Databases to the Web

Connecting Databases to the Web Links Products: Apache: http://www.apache.org/ ASP: http://msdn.microsoft.com/workshop/server/default.asp ColdFusion: http://www.allaire.com/coldfusion/ MySQL: http://www.mysql.com/ Oracle: http://www.oracle.net/ Oracle Technet: http://technet.oracle.net/ PHP: http://www.php.net/ Others: c|net: http://www.builder.com/ DevShed: http://www.devshed.com/Server_Side/ Webmonkey: http://www.hotwired.com/webmonkey/ November 3, 1999 Connecting Databases to the Web