webdatabase / 1 web data bases in this lecture, we will be looking at –the development and use of...
TRANSCRIPT
WebDataBase / 1
Web Data BasesWeb Data Bases
In this lecture, we will be looking at– The development and use of Intranets to share, or to
make available, information and communication to staff– Additional responsibilities of Data Managers– Web Servers– The use of Web browsers to access data stored in
existing, or planned, databases in an Organisation (American term - Enterprise)
– The need to organise information so that it can be quickly and accurately used by people - perhaps now the ‘weak link’ in the Information chain ?
Where are Captain Kirk and Mr. Spock ?
WebDataBase / 2
Web Data BasesWeb Data Bases
• The term ‘Web Data Base’ is a misnomer - the Web (either Internet or Intranet capabilities) is the means of linking multiple databases, and thus supporting many users
• Data Management has a ‘central’ role
• Information can be cost-effectively available to many users (stakeholders is a frequently used term)
WebDataBase / 3
Web Sourced InformationWeb Sourced Information
• Examples of ‘stakeholders’– Customers tracking the status of goods (e.g. Books from
Amazon.com or CDs from CD-Now)– Investors checking funds /shares performance– Banking - status of Accounts, transfers, balances,
mortgages– Suppliers/Contractors checking contract details or
accessing contract requirements– Selection of Orthotics - as with the Caulfield Rehab
Centre
WebDataBase / 4
Web Sourced InformationWeb Sourced Information
• New skills for Data Managers - not Data Base Administrators– Information design
– Web site management
– Database applications for the Web
– Use of Java, XML, C# as application languages
– New technologies - Windows XP, .net
WebDataBase / 5
Web Sourced InformationWeb Sourced Information
Information Architecture:
Deals with the arrangements of ‘data elements’ into an inter-related system
Has its basis in database query design
Web sites consist of pages - each page has the potential of a variety of related information structures
text, hyperlinks, sounds, images, animation, colour patterns (Portals are an example of a multi-type document)
WebDataBase / 6
Web Sourced InformationWeb Sourced Information
There are 7 models for information organisation
– Linear - a book or novel– Parallel - such as an airline timetable– Overlay - X-Ray, MRI, 3 dimensional display (cube)– Matrix - Calendar or similar display ( ? spreadsheet)– Web - thesaurus (ability to move from word to word)– Hierarchical - tennis tournaments, business organisation
chart – Spatial Zoom - ‘drilling’ through layers of information,
magnification or reduction of detail
WebDataBase / 7
Web Sourced InformationWeb Sourced Information
The models may be intertwined
A novel, or a report, may be linear (at the macro level) but contain other model types at the micro (or detail) level.
A report probably will contain matrix organised tables.
It could also have an Hierarchical and a parallel data content and display
WebDataBase / 8
Web Sourced InformationWeb Sourced Information
Information Design
The main objective of deign is to present or convey meaning to the user
What is the design goal of a page ?
How can a collection of linked pages support the design goals of a Web site ?
WebDataBase / 9
Web Sourced InformationWeb Sourced Information
Which organisation model(s) best ‘present’ information - and who decides what is ‘best’ ?
Is user (stakeholder) consultation possible ?
necessary ?
Were you consulted when your favourite web page was designed ?
Are we likely to be dependent on Web page design by a remote agent ?
WebDataBase / 10
Some Web BasicsSome Web Basics
The Internet provides resource sharing among thousands of networks
It is a ‘network of networks’
The Internet uses standard protocols to provide sharing among different kinds of
computers,
operating systems,
communication equipment
WebDataBase / 11
Some Web BasicsSome Web Basics
There are 2 Protocols– Transmission Control Protocol– Internet Protocol
These protocols are known as TCP/IP
WebDataBase / 12
Some Web BasicsSome Web Basics
TCP/IP protocols are also used for private networks , known as intranets
Normally, computers in an Intranet are not normally accessible from computers in the Internet
An intranet (such as Monash University’s) can be protected from outside access by a firewall
WebDataBase / 13
Some Web BasicsSome Web Basics
Client-server database access is necessary in intranets for internal computing requirements.
Client-server database access in the Internet is normally for outside parties - customers and suppliers
WebDataBase / 14
Intranet and Internet RelationshipIntranet and Internet Relationship
Firewall
Intranet
Internet
All connections TCP/IP
WebDataBase / 15
Some Web BasicsSome Web Basics
Some terms:
HTTP - Hypertext Transfer Protocol - this establishes a session between a browser and a Web server.
During a session, the browser and the server interact to send and receive files which contain Web pages
Each page has a unique address - the Uniform Resource Locator (URL).
WebDataBase / 16
Some Web BasicsSome Web Basics
URL:
The first part of a URL specifies the protocol of a service
The second part specifies a computer on the Internet which contains the file. Communications devices (routers and gateways) translate the second part unto a numeric IP address
The third part specifies a path to a file containing the page
e.g. http://www.microsoft.com/products/default.html
http is the service
www.microsoft.com is the computer
products/default.html indicates the directory and the file name of the page
WebDataBase / 17
Some Web BasicsSome Web Basics
Web pages are written in a language called
‘Hytertext Markup Language’ - HTML
(or are translated to this by Word Hyperlink, Front Page or other software)
A browser displays pages on a PC by interpreting HTML code in the file sent by a server.
Part of the HTML can contain ‘hyperlinks’ - or requests for other pages
WebDataBase / 18
Some Web BasicsSome Web Basics
Web browsers support older Internet protocols
File Transfer protocol - FTP, used for transferring data files such as word-processing documents and spreadsheets
.htm extension files - indicates older DOS based 3 character extension files e.g. /Myfile.htm
Creating HTML files - text editor (Windows Notepad)
HTML convertor (Microsoft Word)
HTML Editor - Microsoft Front Page
WebDataBase / 19
Some Web BasicsSome Web Basics
A fairly typical HTML Document Structure
<html>
<head>
<title> [Web page title text] </title>
</head>
<body>
[Web page content text and tags]
</body>
</html>
The beginning <html> and ending </html> paired tags inform the Web browser that the enclosed text is to be treated as a HTML document
WebDataBase / 20
Some HTML codeSome HTML code
<html><head><title> Order Tracking</title></head>
<body>
<h1 align=center>Order tracking</h1>
<form action=‘Omit for now’>
<center><table width=“70%” border=“1”>
<tr><td width=“38%” align=“right”>
select a time period:</td>
<td width=“62%” align=“left”>
<input type=‘Radio” checked name=“optTime” value=”week” within last week<br>
<input type=“Radio” name=“optTime” value=“month”> within last month<br>
<input type=“Radio” name=“optTime” value=“year”>within last year<br>
WebDataBase / 21
Some HTML CodeSome HTML Code
<input type=“radio” name=‘optTime” value=“All”>AllOrders</td></tr>
<tr><td> align=“center” colspan=“2”>
<b>or</b>
<b><small><I>(If an Order ID is entered,the selected time period will be ignored)</small></I></td></tr>
<tr><td align=“right”
Enter an OrderID:</td>
<td align = “left”>
<input type=“text” name+”txtOrderid” size=“20”></td></tr>
</table>< br><input type=button name=“cmdSubmit”
value=“submit query”></center>
</form></body></html>
WebDataBase / 22
Some Web BasicsSome Web Basics
There are some limitations with HTML– Content, structure and page formatting are mixed
together
– This leads to difficulties in searching for Web pages, display Web pages in different formats for different devices, and standardisation of Web page content
Therefore to support the rapid growth of the Web, the ability to search, display and standardise Web pages must improve
WebDataBase / 23
Some Web BasicsSome Web Basics
Enter from left with alarums (Shakespeare)
1. XML (eXtensible Markup Language and
2. XSL (eXtensible Style Language)
XML provides a clean separation between structure and content of a document
The Document Type Declaration section of an XML document provides field names, field properties, and also the structure of the fields
WebDataBase / 24
Some Web BasicsSome Web Basics
XSL supports the transformation of of XML Documents into HTML and other display languages
Both languages are extensible.
They support the development of industry-specific standards for document content, structure and display
WebDataBase / 25
Web Page Request CycleWeb Page Request Cycle
1. User clicks hyperlink
2. Browser sends requestto Web server
3. Web server locatespage
4. Web server sendsfile
5. Browser displaysfile
WebDataBase / 26
XML and XSL Server/BrowserXML and XSL Server/Browser
In the previous diagram, the server and/or the browser may be able to processing XML and XSL in addition to HTML.
If the browser has XML and XSL processors, the server can send XML and XSL to the browser instead of HTML
The browser can then transform the XML and XSL into HTML and then display the HTML
If the browser does not contain XML and XSL, the server can process the XML and XSL and send HTML to the browser
WebDataBase / 27
Common Gateway InterfaceCommon Gateway Interface
This allows a Web server to communicate with an external program, and to pass parameters to it (much like Segments and packages in PL/SQL).
The external program then uses the passed parameters to produce output which is sent back to the browser
The output normally contains HTML so that it can be displayed properly by the browser
CGI is portable across most Web servers. The external program may not be portable
WebDataBase / 28
Common Gateway InterfaceCommon Gateway Interface
The external program can be written in a compiled language such as C, or an interpreted language such as Perl
WebDataBase / 29
Common Gateway InterfaceCommon Gateway Interface
CGI offers several ways of providing database connectivity
In the ‘normal’ CGI approach, the external program sends SQL statements to the database server and then encodes the result in HTML or XML format
Web Server External Program Database Server
Parameters SQL
HTML/XML Results
WebDataBase / 30
Common Gateway InterfaceCommon Gateway Interface
In a ‘hybrid’ approach, the external program sends SQL statements to a partner program which interacts with a database server. This method generally provides better performance - the partner program manages database connections among multiple CGI processes and performs some middleware functions
Web Server External Program Database Server
Parameters SQL
HTML/XML Results
Partner Program
Parameters
HTML/XML
WebDataBase / 31
Common Gateway InterfaceCommon Gateway Interface
However, there could be a catch - the hybrid CGI approach may not scale to many simultaneous users (remember concurrency ?)
A better approach is to add additional process management functions in the Web server so that the Web server communicates directly with the database server
and that of course is what we are going to look at next
WebDataBase / 32
Common Gateway InterfaceCommon Gateway Interface
The 2 terms which will be mentioned are
1. Server-side connectivity
and
2. Client-side connectivity
The 2 diagrams following may help to illustrate these
WebDataBase / 33
Server-Side ConnectivityServer-Side Connectivity
This by-passes the external program needed with the CGI approach.
There is direct communication between the Web server and the database server
However, a specialised server may be needed to provide the direct connection between the Web server and the database server
This ‘special’ server supports management of simultaneous users, support for transactions which span multiple Web pages and message queuing
WebDataBase / 34
Server-Side ConnectivityServer-Side Connectivity
Web serverwithmiddleware extension
DatabaseServer
SQL Statementsand Formatting requirements Database
HTML/XML
SQL
WebDataBase / 35
Server-Side ConnectivityServer-Side Connectivity
There is a limitation with the previous configuration
There is the need for a specialised Web server
This is overcome by a middleware server
The middleware contains a ‘listener’ component which routes database requests to the middleware server
The middleware server provides transaction management and queuing services
WebDataBase / 36
Server-Side ConnectivityServer-Side Connectivity
Web Server
Middlewareserver withListener
DatabaseServer
DatabaseRequest
SQL
ResultsHTML/XML
SQL statements and formattingrequirements
Database
WebDataBase / 37
Server-Side ConnectivityServer-Side Connectivity
The server-side approaches provide strong and robust services for transaction processing as well as a software bus for accessing and using remote objects
The specialised Web servers and the middleware servers normally support many hundreds to thousands of simultaneous users
Software buses are built into specialised Web servers and Middleware servers and provide transparent access to objects which are distributed across the Internet
WebDataBase / 38
Client-Side ConnectivityClient-Side Connectivity
In the server-side approaches, the browser is limited to interpretation of HTML
And even with the later versions of HTML which contain scripting capabilities (DHTML), the client computing capabilities may be underutilised
The client-side approach utilises available computing capabilities without storing the code on the client (remember cookies and donuts ?)
WebDataBase / 39
Client-Side ConnectivityClient-Side Connectivity
In the following diagram, there are two very brief outlines to enhance client interfaces for database processing
You have probably heard of Java - it’s a language intended for embedded applications
You may have come also across ActiveX - An ActiveX object is a binary file which can be executed directly on a PC client.
WebDataBase / 40
Client-Side ConnectivityClient-Side Connectivity
And a Java applet ? It is a ‘special’ program which executes inside a virtual machine located in a Web browser - the virtual machine prevents an applet from damaging the resources of a PC. (strange but true)
A Web server sends a Java applet to a requesting Web browser inside a PC client.
After receiving the applet, the Web browser executes it to produce specified effects on the browser
WebDataBase / 41
Client-Side ConnectivityClient-Side Connectivity
ActiveX
An ActiveX object is a binary file which can be executed directly on a PC client.
No virtual machine is used for ActiveX objects
A Web server sends an ActiveX object as a result of a request by a PC client
ActiveX objects can execute inside a browser or as separate processes
WebDataBase / 42
Client-Side Connectivity - Web Page Request Cycle
Client-Side Connectivity - Web Page Request Cycle
Web server sends filecontaining HTML/XMLand embedded applet(Java) or binary object(ActiveX)
Browser sends requestto Web server
WebDataBase / 43
Client-Side ConnectivityClient-Side Connectivity
Final Comments
The client-side approaches can be integrated with the server-side approaches
This provides the advantages of a multiple-tier client-server architecture with a customised interface on a PC client
PC clients remain thin, because the customisation code (Applets and Objects) resides on a remote server.
PC clients can execute remote code on other servers through Java or ActiveX code
WebDataBase / 44
Some Web BasicsSome Web Basics
Client-Server Computing with Middleware
Middleware
WebDataBase / 45
Some Web BasicsSome Web Basics
Two Tier Architecture
SQL Statements DatabaseServer
Database
Query Results
WebDataBase / 46
Three Tier Architecture - Middleware Server
Three Tier Architecture - Middleware Server
Middleware DatabaseServer Server
SQL Statements
Query Results
WebDataBase / 47
Three Tier Architecture - Application Server
Three Tier Architecture - Application Server
SQL Statements
Database Server Application Server
Query Results
WebDataBase / 48
Some Web BasicsSome Web Basics
Database access:
Additional servers and interactions assist the browser (or extend its capabilities) and the web server functions of the previous diagram
The Web server supports all (or mostly all) requests from a browser
A Web server does not provide the same services as database middleware
WebDataBase / 49
MiddlewareMiddleware
So, what is this ‘middleware’
A major function of middleware is to support ‘interoperability’
Clients, and servers, can exist on platforms with different hardware, operating systems, DBMSs and program languages
Middleware allows a client and server to ‘be aware’ of each other and to communicate without knowledge of each other’s platform
WebDataBase / 50
MiddlewareMiddleware
Another function of middleware is efficient message control
Normally in a client-server environment there are many clients communicating with a lesser number of servers (remember that a ‘server’ can become a ‘client’ can become a ‘server’)
A server can become overloaded managing messages rather than performing the process tasks requirements
WebDataBase / 51
MiddlewareMiddleware
Middleware frees up servers from managing request messages and allows servers to concentrate on the processes associated with completing requests for services
Middleware can perform queuing, scheduling and message routing
This allows clients and servers to work at different speeds and times (sounds like the functions of an operating system ?)
WebDataBase / 52
MiddlewareMiddleware
Types of middleware
1. Transaction processing monitors - These relieve the operating system of managing database processes. A transaction processing monitor can switch control among processes much faster than an Operating system (any ideas why this is so ?)
A transaction processing monitor receives transactions, schedules them, and manages them until the process is complete.
Transaction processing monitors also get involved with updating multiple databases, and multiple sets of data, in a single transaction - remember a ‘database transaction ?)
TPM’s are the oldest form of middleware
WebDataBase / 53
MiddlewareMiddleware
2. Message orientated middleware - these maintain queues of messages (based on queuing theory).
A client process can place a message on a queue and a server process can remove a message from a queue
The major difference between Type 1 (transaction-processing middleware) and Type 2 is in the ‘intelligence’ of the messages. (which tends to be the way in which software becomes ‘smarter’ as in say MS2000 and MS XP operating systems)
WebDataBase / 54
MiddlewareMiddleware
Transaction processing monitors provide built-in intelligence but use simple messages
Message orientated middleware provides less built-in intelligence but support more complex messages
3. Object-request brokers - these provide a high level of interoperability and message intelligence. Object-request broker messages must be encoded in a standard interface language
An object-request broker (ORB) resolves platform differences between a client and a server
A client can communicate with a server without knowing the location of a server (Corba, D-Comm)
WebDataBase / 55
Connectivity SummaryConnectivity Summary
Approach Product
Straight CGI Apache Web server with external
PERL program
Hybrid CGI Apache Web server with Cold Fusion server extensions
Extended Web Internet Information Server with
server (server-side Microsoft Transaction Server
connectivity)
Middleware-server Oracle Application Server
(server side connectivity)
Client-side Microsoft Remote Data Service,
connectivity Java relational Model Interface
WebDataBase / 56
Client Side ScriptsClient Side Scripts
Scripts are used for data validation within HTML forms
In many cases HTML form inputs do not require large applications and the script will be faster than creating a compiled program
Scripts can be modified using a script editor
Modifying a compiled program means that the necessary programming environment must be installed on the user workstation, the original source code must also be available, and after the source code is modified, the program must be recompiled, tested and finally, included in the system library
WebDataBase / 57
Client Side ScriptsClient Side Scripts
Server side scripts are created using Active Server pages commonly known as ASPs
JavaScript is a client side scripting language. It is supported by Netscape Navigator and Microsoft Internet Explorer
JavaScript syntax is similar to C, C++ and Java
JavaScript client-side scripts can be added to standard HTML Web pages using special HTML tags
WebDataBase / 58
Client Side ScriptsClient Side Scripts
The following code ensures that a user has entered a name in a form input box
<html>
<head>
<title> Monash Traders - Order Tracking</title>
</head>
<body>
<h2>Monash Traders - Order Tracking<h2>
WebDataBase / 59
Client Side ScriptsClient Side Scripts
<script language = “JavaScript”>
<! -- hide this script from old browsers
Function validate(){
if (document.login.username.value ==“”) {
alert (“Please enter your name!”)
return
}
alert (“ Thanks for entering your name, “ +
document.login.username.value + “!”
document.login.submit()
}
//-->
</script>
WebDataBase / 60
Client Side ScriptsClient Side Scripts
<form name=“login” onsubmit=“validate()”>
please enter your name:
<input type= “text” name+ “username” size=“20”
<input type=“submit”>
</form>
</body>
</html>
WebDataBase / 61
Scripting LanguagesScripting Languages
Server side scripts:
An ASP is a text file (.asp) and contains server-side script commands which can perform tasks such as inserting, updating, and retrieving data from a database.
An ASP also contains HTML commands for creating a formatted Web page
ASPs are Microsoft specific technology, and can only be processed on Microsoft Web servers (Personal Web Server, MS Internet Information Server). Netscape has server-side scripting technology called LiveWire which is similar to Active Server Pages
WebDataBase / 62
Server-Side ScriptsServer-Side Scripts
And finally :-
Scripts within ASPs can be created using VBScript (the default ASP scripting language), and Jscript (Microsoft’s JavaScript implementation)
and ASPs are processed on a Web server and files must be stored and run from a folder on the Web server - they cannot be displayed from a folder on the user’s workstation using a file URL.