15
SDPL 2001 Notes 7: XML Web Sites 1 7 XML Web-Site 7 XML Web-Site Architectures Architectures How (and why) to apply XML techniques How (and why) to apply XML techniques in the in the implementation of Web sites implementation of Web sites ? ? 7.1 XML, Databases, and Multi-tiered 7.1 XML, Databases, and Multi-tiered Systems Systems Overview of Web-based applications built using Overview of Web-based applications built using XML & database technology and multi-tiered XML & database technology and multi-tiered architectures architectures Later: Later: 7.2 Apache Cocoon publishing framework 7.2 Apache Cocoon publishing framework

SDPL 2001Notes 7: XML Web Sites1 7 XML Web-Site Architectures n How (and why) to apply XML techniques in the implementation of Web sites? 7.1 XML, Databases,

Embed Size (px)

Citation preview

Page 1: SDPL 2001Notes 7: XML Web Sites1 7 XML Web-Site Architectures n How (and why) to apply XML techniques in the implementation of Web sites? 7.1 XML, Databases,

SDPL 2001 Notes 7: XML Web Sites 1

7 XML Web-Site Architectures7 XML Web-Site Architectures

How (and why) to apply XML techniques in How (and why) to apply XML techniques in the the implementation of Web sitesimplementation of Web sites??

7.1 XML, Databases, and Multi-tiered Systems7.1 XML, Databases, and Multi-tiered Systems– Overview of Web-based applications built using XML & Overview of Web-based applications built using XML &

database technology and multi-tiered architecturesdatabase technology and multi-tiered architectures

Later: Later:

7.2 Apache Cocoon publishing framework7.2 Apache Cocoon publishing framework

Page 2: SDPL 2001Notes 7: XML Web Sites1 7 XML Web-Site Architectures n How (and why) to apply XML techniques in the implementation of Web sites? 7.1 XML, Databases,

SDPL 2001 Notes 7: XML Web Sites 2

7.1 XML, Databases, and Multi-tiered Systems7.1 XML, Databases, and Multi-tiered Systems

J. Chelsom, J. Chelsom, InterCHANGEInterCHANGE, Oct. 1999, 7-12., Oct. 1999, 7-12.

Why to use XML at a Web site?Why to use XML at a Web site? How to store XML documents?How to store XML documents? Multitiered architectures?Multitiered architectures?

Page 3: SDPL 2001Notes 7: XML Web Sites1 7 XML Web-Site Architectures n How (and why) to apply XML techniques in the implementation of Web sites? 7.1 XML, Databases,

SDPL 2001 Notes 7: XML Web Sites 3

Advantages of XML based solutions?Advantages of XML based solutions?

Creating and delivering final document Creating and delivering final document representations (HTML, PDF, …) more representations (HTML, PDF, …) more straightforward than using XMLstraightforward than using XML

Why then XML-based web sites?Why then XML-based web sites?– control of uniform style (via style sheets)control of uniform style (via style sheets)– processing of semantic content (XML) on the clientprocessing of semantic content (XML) on the client– utilising XML processing capabilities on the server utilising XML processing capabilities on the server – tailoring different versions of the same contenttailoring different versions of the same content

» for different browsers, different user groups, for different browsers, different user groups, different uses (browsing, printing, audio, …)different uses (browsing, printing, audio, …)

Page 4: SDPL 2001Notes 7: XML Web Sites1 7 XML Web-Site Architectures n How (and why) to apply XML techniques in the implementation of Web sites? 7.1 XML, Databases,

SDPL 2001 Notes 7: XML Web Sites 4

XML and DatabasesXML and Databases

How to store and to manage XML documents? How to store and to manage XML documents? Depends on application requirements:Depends on application requirements:– file systemfile system

» simple and cheapsimple and cheap» often sufficient, especially if collection small and staticoften sufficient, especially if collection small and static

– database management systems database management systems » provide efficient access to large data collectionsprovide efficient access to large data collections» more appropriate when documents dynamically modified, more appropriate when documents dynamically modified,

especially if simultaneously by multiple usersespecially if simultaneously by multiple users» provide consistency and integrity preserving "ACID" provide consistency and integrity preserving "ACID"

transactionstransactions

Page 5: SDPL 2001Notes 7: XML Web Sites1 7 XML Web-Site Architectures n How (and why) to apply XML techniques in the implementation of Web sites? 7.1 XML, Databases,

SDPL 2001 Notes 7: XML Web Sites 5

Database TransactionsDatabase Transactions

TransactionTransaction – semantically meaningful unit of update operationssemantically meaningful unit of update operations– e.g., money transfer btw two bank accountse.g., money transfer btw two bank accounts

ACIDACID properties of transactions properties of transactions– AAtomicity: tomicity: either all changes or none are committedeither all changes or none are committed

– CConsistency: onsistency: transactions maintain consistency of datatransactions maintain consistency of data

– IIsolation: solation: transactions do not interfere with each othertransactions do not interfere with each other

– DDurability: urability: committed updates are stored permanentlycommitted updates are stored permanently

Page 6: SDPL 2001Notes 7: XML Web Sites1 7 XML Web-Site Architectures n How (and why) to apply XML techniques in the implementation of Web sites? 7.1 XML, Databases,

SDPL 2001 Notes 7: XML Web Sites 6

Types of XML databasesTypes of XML databases

1. XML generating databases1. XML generating databases– database not aware of XML, which is just an output database not aware of XML, which is just an output

format for data extracted format for data extracted (using SQL/OQL/JSP/…)(using SQL/OQL/JSP/…)

2. XML document databases2. XML document databases– fields for entire documents or document fragmentsfields for entire documents or document fragments– metadata fields to support management of these chunksmetadata fields to support management of these chunks

3. XML component databases3. XML component databases– "true XML databases""true XML databases"– store document components as separate objectsstore document components as separate objects– schema for document objects corresponds to DTDschema for document objects corresponds to DTD

Page 7: SDPL 2001Notes 7: XML Web Sites1 7 XML Web-Site Architectures n How (and why) to apply XML techniques in the implementation of Web sites? 7.1 XML, Databases,

SDPL 2001 Notes 7: XML Web Sites 7

Commercial XML databasesCommercial XML databases

Steve Pepper's "Whirlwind guide" of SGML/XML Steve Pepper's "Whirlwind guide" of SGML/XML tools (Dec. 99) mentioned tools (Dec. 99) mentioned – 10 document DB managers; 1 with XML support10 document DB managers; 1 with XML support

» SigmaLink of STEP GmbHSigmaLink of STEP GmbH

– 6 component DB managers, 3 with XML support6 component DB managers, 3 with XML support» Astoria, POET Content Mgmt Suite, TARGET 2000Astoria, POET Content Mgmt Suite, TARGET 2000

» strong development activity underway by major O-O and strong development activity underway by major O-O and relational database vendorsrelational database vendors

Prizes of high-end XML database systems around USD Prizes of high-end XML database systems around USD 40,000 - 100,000 (including configuration, installation and 40,000 - 100,000 (including configuration, installation and integration to business processes)integration to business processes)

Page 8: SDPL 2001Notes 7: XML Web Sites1 7 XML Web-Site Architectures n How (and why) to apply XML techniques in the implementation of Web sites? 7.1 XML, Databases,

SDPL 2001 Notes 7: XML Web Sites 8

Commercial XML databases (2)Commercial XML databases (2)

Ronald Bourret,Ronald Bourret, Nov. 2000: Nov. 2000: http://www.rpbourret.com/xml/XMLDatabaseProds.htmhttp://www.rpbourret.com/xml/XMLDatabaseProds.htm

– 5 5 XML-enabled databasesXML-enabled databases XML generating/document databasesXML generating/document databases

» DB2 XML Extender, MS SQL Server 2000, Oracle 8i & 9i, … DB2 XML Extender, MS SQL Server 2000, Oracle 8i & 9i, …

– 8 8 native XML databasesnative XML databases XML component databases (?)XML component databases (?) 3 RD prototypes, rest commercial products (?)3 RD prototypes, rest commercial products (?)

– Also Also middleware, XML servers, XML application middleware, XML servers, XML application servers, content management systems, persistent servers, content management systems, persistent DOM implementationsDOM implementations: classification often difficult: classification often difficult

Page 9: SDPL 2001Notes 7: XML Web Sites1 7 XML Web-Site Architectures n How (and why) to apply XML techniques in the implementation of Web sites? 7.1 XML, Databases,

SDPL 2001 Notes 7: XML Web Sites 9

Three-tiered architecturesThree-tiered architectures

Typical architecture of web-based data Typical architecture of web-based data delivery/processing applications:delivery/processing applications:– client tier (or layer)client tier (or layer)

» standard web browser (+ possible additions)standard web browser (+ possible additions)– middle tier / applications layermiddle tier / applications layer

» "business logic" running on server"business logic" running on server» can be viewed or realised as number of separate tierscan be viewed or realised as number of separate tiers

(-> (-> "multitiered architectures""multitiered architectures"))– data tier (or layer)data tier (or layer)

» storage and maintenance of datastorage and maintenance of data

Page 10: SDPL 2001Notes 7: XML Web Sites1 7 XML Web-Site Architectures n How (and why) to apply XML techniques in the implementation of Web sites? 7.1 XML, Databases,

SDPL 2001 Notes 7: XML Web Sites 10

Why three-tiered architectures?Why three-tiered architectures?

HTTP client + server + data source is a HTTP client + server + data source is a convenient implementation environmentconvenient implementation environment– familiar browser user-interface familiar browser user-interface – standard components (browsers & servers)standard components (browsers & servers)

» cheap (free)cheap (free)» available on various OS & HW platforms available on various OS & HW platforms

– minimal start-up pain for new users or minimal start-up pain for new users or customerscustomers

Page 11: SDPL 2001Notes 7: XML Web Sites1 7 XML Web-Site Architectures n How (and why) to apply XML techniques in the implementation of Web sites? 7.1 XML, Databases,

SDPL 2001 Notes 7: XML Web Sites 11

Where XML gets processed?Where XML gets processed?

Two major strategies:Two major strategies:1. to deliver XML to client 1. to deliver XML to client

» and to use, say, and to use, say, SAX/DOM-based applets or DOM-based scripts for SAX/DOM-based applets or DOM-based scripts for processing, andprocessing, andCSS, or XSLTCSS, or XSLTHTML(+CSS) for presentationHTML(+CSS) for presentation

2. to process XML on the server2. to process XML on the server» and to deliver plain HTML (+CSS) to clientand to deliver plain HTML (+CSS) to client

Which one to choose?Which one to choose?

Page 12: SDPL 2001Notes 7: XML Web Sites1 7 XML Web-Site Architectures n How (and why) to apply XML techniques in the implementation of Web sites? 7.1 XML, Databases,

SDPL 2001 Notes 7: XML Web Sites 12

Delivering XML to web clientsDelivering XML to web clients

Advantages:Advantages:– single semantically marked-up XML document may single semantically marked-up XML document may

correspond to multiple single-purpose HTML pagescorrespond to multiple single-purpose HTML pages– reduces network traffic and moves processing load reduces network traffic and moves processing load

from server to clientfrom server to client

DisadvantagesDisadvantages– assumes XML capable browsersassumes XML capable browsers– application development for unknown client application development for unknown client

environments difficultenvironments difficult

Page 13: SDPL 2001Notes 7: XML Web Sites1 7 XML Web-Site Architectures n How (and why) to apply XML techniques in the implementation of Web sites? 7.1 XML, Databases,

SDPL 2001 Notes 7: XML Web Sites 13

Delivering XML to web clients (2)Delivering XML to web clients (2)

Disadvantages (continued)Disadvantages (continued)– exposure of data structures (XML) and "business logic" exposure of data structures (XML) and "business logic"

(applets or scripts) to customers(applets or scripts) to customers

XML processing on client may be a viable XML processing on client may be a viable solution in controlled environments like intranets solution in controlled environments like intranets (clients uniform, users trusted)(clients uniform, users trusted)

"XML on server, HTML to client" strategy gained "XML on server, HTML to client" strategy gained more popularity recentlymore popularity recently

Page 14: SDPL 2001Notes 7: XML Web Sites1 7 XML Web-Site Architectures n How (and why) to apply XML techniques in the implementation of Web sites? 7.1 XML, Databases,

SDPL 2001 Notes 7: XML Web Sites 14

Processing XML on serverProcessing XML on server

plain HTML delivered to clientsplain HTML delivered to clients Advantages:Advantages:

– support of non-XML-capable browserssupport of non-XML-capable browsers» (Next section discusses taking of different HTML browsers into (Next section discusses taking of different HTML browsers into

account)account)» ability to address wider audiencesability to address wider audiences

– "semantic firewall""semantic firewall"» document structures and business logic remain unexposeddocument structures and business logic remain unexposed

– control over processing environment (server)control over processing environment (server)» easier application development and testingeasier application development and testing» control over performancecontrol over performance

Page 15: SDPL 2001Notes 7: XML Web Sites1 7 XML Web-Site Architectures n How (and why) to apply XML techniques in the implementation of Web sites? 7.1 XML, Databases,

SDPL 2001 Notes 7: XML Web Sites 15

Processing XML on server (2)Processing XML on server (2)

Disadvantages:Disadvantages:– may increase data traffic: a new HTML page for each may increase data traffic: a new HTML page for each

different view on the documentdifferent view on the document– fails to utilise (often idle) processing cycles of client fails to utilise (often idle) processing cycles of client

computerscomputers– heavier network and server loadheavier network and server load

Combinations of client/server processing also Combinations of client/server processing also possible: Deliveringpossible: Delivering– "downgraded" XML to clients"downgraded" XML to clients– XML to selected clients onlyXML to selected clients only