DAVID M KROENKES DATABASE CONCEPTS 2 nd Edition
DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition Chapter Seven Advanced Topics DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall
Chapter Objectives Understand the nature, need and importance of the following topics: Web database processing Database processing with XML Distributed database processing OLAP and data mining Object-relational database management DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 2
Web Database Processing • Client computers use browsers • Web server communicates via Hypertext Transfer Protocol (HTTP) and scripting / programming languages to browsers and DBMS • DBMS communicates with database DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 3
Web Database Processing Environment DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 4
N-Tier Architecture • Tiers refers to the number of computers involved in the Web database application – The user’s workstation with its’ Web browser is the first tier – Two-tier architecture means that the Web server and the DBMS are on the same server – Three-tier architecture means that the Web server and the DBMS are on separate servers DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 5
Typical Web Server Setups Microsoft Windows Linux or Unix Web Server Internet Information Apache Server (IIS) Scripting Languages (Interpreted ASP Pages with VBScript or JScript (PHP also works) PHP Object Oriented Languages (Complied) ASP. NET pages with Visual. Basic. Net, C#. Net or others JSP pages with Java (Also see the Mono project) DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 6
Typical Web DBMS Servers Microsoft Windows Linux or Unix Web Server Internet Information Server (IIS) Apache DBMSs Microsoft SQL Server Oracle My. SQL API Interface Standard ODBC JDBC DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 7
API Interface Standards • Every DBMS has a different application program interface (API) • API interface standards are used to make it easier for programmers – they write to the interface standard instead of the DBMS API – OBDC – Open Database Connectivity – JDBC – Not an acronym for anything! (in particular, not Java Database Connectivity) DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 8
Sample HTML Code <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows 1252"> <TITLE>Artist</TITLE> </HEAD> <!--#include virtual="ADOExamples/adovbs. inc"--> <BODY> DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 9
Sample ASP Code <% Dim obj. Conn, obj. Record. Set, var. Sql If Is. Object(Session("_conn")) Then ' if already have a connection, use it Set obj. Conn = Session("_conn") Else Set obj. Conn = Server. Create. Object("ADODB. connection") ' get connection obj. Conn. open "View. Ridge. SS" ' open VRG database using operating system authentication obj. Conn. Isolation. Level = ad. Xact. Read. Committed ' avoid dirty reads Set Session("_conn") = obj. Conn End If DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 10
Sample ASP Code (continued) Set obj. Record. Set = Server. Create. Object("ADODB. Recordset") ' create the record set object var. Sql = "SELECT Name, Nationality FROM ARTIST" ' set up SQL command obj. Record. Set. Open var. Sql, obj. Conn, ad. Open. Static, ad. Lock. Read. Only ' static with no need to update %> DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 11
Database Procesing with XML • Extensible Markup Language (XML) is a standard for defining the structure of documents and communicating the documents among computers • It provides user definable tags that can be used in Web pages and other documents DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 12
Sample XML document <? xml version="1. 0" encoding="UTF-8"? > <!DOCTYPE customer SYSTEM "C: XML Docscustomer. dtd"> <customer> <name> <firstname>Michelle</firstname> <lastname>Correlli</lastname> </name> <address> <street>1824 East 7 th Avenue</street> <unit>Suite 700</unit> <city>Memphis</city> <state>TN</state> <zip>32123 -7788</zip> </address> </customer> DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 13
XML Schema Documents • XML schema documents define allowable tags and their relationships DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 14
XML Document Validation • An XML document can declare the name and location of the schema that defines its tags • XML documents that conform to their XML schemas are schema-valid documents • XML schema documents are XML documents, and can be validated against their designated schema • The “Schema of all schemas” is at www. w 3. org/2001/XMLSchema DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 15
Sample XML Schema <? xml version="1. 0" encoding="UTF-8"? > <xsd: schema xmlns: xsd="http: //www. w 3. org/2001/XMLSchema" element. Form. Default="qualified" attribute. Form. Default="unqualified"> <xsd: element name=“CUSTOMER-DATA"> <xsd: complex. Type> <xsd: sequence> <xsd: element name=“CUSTOMER"> <xsd: complex. Type> <xsd: sequence> <xsd: element name="Name"/> <xsd: element name="Phone/> <xsd: element name="Email"/> </xsd: sequence> </xsd: complex. Type> </xsd: element> </xsd: schema> DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 16
XML and Database Processing • DBMS programs are incorporating means to read and create XML documents • SQL Server example: SELECT FROM * ARTIST FOR XML AUTO, ELEMENTS; DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 17
XLM Web Services • XML Webs Services allows application functionality on one Web server to be shared and incorporated into Web applications on other Web servers DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 18
Distributed Database Processing • A database is distributed when it is: – Partitioned – Replicated – Both partitioned and replicated • This is fairly straight forward for readonly replicas, but it can be very difficult for other installations DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 19
Type of Distributed Databases DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 20
OLAP and Data Mining • On. Line Analytical Processing (OLAP) is a technique for dynamically examining database data – OLAP uses arithmetic functions (Sum, Average, etc) • Data Mining is a mathematically sophisticated technique for analyzing database data – Data mining use mathematical and statistical techniques DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 21
OLAP • OLAP uses a table called an OLAP cube • The OLAP cube uses inputs called dimensions • The OLAP cube calculates outputs called measures DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 22
Sample OLAP Cube DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 23
Data Mining Techniques • Data Mining mathematical and statistical techniques include: – Cluster analysis – Regression analysis – Time-series analysis – Factor analysis – Nonparametric Monte Carlo analysis DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 24
Object-Relational Database Management • Object-oriented programming (OOP) is based on objects, and OOP is now used as the basis of many computer programming languages – Java – Visual. Basic. Net – C++ – C# DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 25
Objects • Object classes have – Identifiers – Properties • These are data items associated with the object – Methods • These are programs that allow the object to perform tasks • The only difference between entity classes and object classes is the methods. DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 26
Object Persistence • Object persistence means that values of the object properties are storable and retrievable • Object persistence can be achieved by various techniques – A main technique is database technology – Relational databases can be used, but require substantial programming DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 27
OODBMS • Object-Oriented DBMSs (OODBMSs) have been developed – Never achieved commercial success • It would be too expensive to transfer existing data from relational and other legacy databases • Therefore, the OODBMSs were not cost justifiable DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 28
Object-Relational DBMSs • Some relational DBMS vendors have added object-oriented features to their products – Oracle • These products are known as objectrelational DBMSs and support objectrelational databases DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall 29
DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition End of Presentation on Chapter Seven Advanced Topics DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition © 2005 Pearson Prentice Hall
- Slides: 30