Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group...

29

Transcript of Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group...

Page 1: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.
Page 2: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

Building High-Performance Enterprise XML Applications with Oracle Database 10g

Mark ScardinaGroup Product Manager & XML Evangelist

Oracle Corporation

Session id: 40020

Page 3: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

Why You Need XML

Expanding business – XML is widely accepted as the standard data exchange

format for B2B, B2C and EAI applications Moving legacy applications to the Internet

– XML incorporates metadata with data facilitating cross platform data exchange

Building e-Business applications over the Internet– XML provides powerful data abstraction for transaction data

management and exchange Publishing content across media and device types

– XML provides flexible content representations and easy transformations

Page 4: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

Why XML Demands High Performance

Encapsulation of data increase payload size Standards require character-based processing

– XML Schema validation– XSLT stylesheet transformation

XSL transformations require expensive DOM Content needs data-binding for application

processing

Page 5: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

Oracle XML Developer’s Kit 10g High Performance Standards-based libraries and utilities

to generate, manipulate, render and store XML Includes:

– XML Parser– XSLT Processor and XSLTVM– XML Schema Processor– XML Class Generators– XML Java Beans– XML SQL Utility– XSQL Servlet– SOAP Services– XML Pipeline Processor

Available for Java, C, and C++ Available in Servers and free of charge from OTN

Page 6: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

W3C/JSR Standards Support

Standard Version Language Standard Version Language Standard Version Language Standard Version Language

XMLXMLXMLXML Java, C/C++Java, C/C++1.01.0

XML NamespacesXML NamespacesXML NamespacesXML Namespaces Java, C/C++Java, C/C++1.01.0

DOMDOMDOMDOM Java, C/C++Java, C/C++1.0/2.0/1.0/2.0/3.03.0

SAX + ExtensionsSAX + ExtensionsSAX + ExtensionsSAX + Extensions Java, C/C++Java, C/C++1.0/2.01.0/2.0

XSLT + XPathXSLT + XPathXSLT + XPathXSLT + XPath Java, C/C++Java, C/C++1.0/1.0/2.02.0

XML SchemaXML SchemaXML SchemaXML Schema Java, C/C++Java, C/C++1.01.0

SOAPSOAPSOAPSOAP JavaJava1.11.1

JAXPJAXPJAXPJAXP JavaJava1.11.1

JAXBJAXBJAXBJAXB JavaJava1.01.0

Page 7: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

Oracle XDK 10g: XML to the Power of SQL

Build Oracle 10g XML OCI Applications – Directly access XMLType DOM

Utilize High Performance XSL Transformations– XSLT Compiler and Virtual Machine

Efficiently Generate Large XML documents– Stream-based retrieval

Speed XML Processing with Stream-based XML– One step XML validation and transformation

Page 8: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

Build OCI XML DB Applications

New C APIs for working with XMLType Unified development in/out of Oracle DB 10g

– Common XML* C interfaces for XML and XMLType

– Eliminates parsing and DOM construction

Fast and Efficient XML processing of DB data– Directly work with the XMLType DOM (XOB)– Eliminates serializing and reparsing

Page 9: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

XDK Unified DOM C Code Sample

/* Get an xml context */     params[0].name_ocixmldbparam = XCTXINIT_OCIDUR;     params[0].value_ocixmldbparam = &dur;     xctx = OCIXmlDbInitXmlCtx(envhp, svchp, errhp, params, 1);    /* Parse a schema-based document */     if (!(doc = XmlLoadDom(xctx, &err, "buffer", lpxml_test_sch, "buffer_length",

sizeof(tlpxml_test_sch)-1, "validate", TRUE, NULL))) /* Create some elements and add them to the document */     top = XmlDomGetDocElem(xctx, doc); foo = (xmlnode *) XmlDomCreateElem(xctx, doc, (oratext *) "FOO"); foo_data = (xmlnode *) XmlDomCreateText(xctx, doc, (oratext *) "data");    foo_data = XmlDomAppendChild(xctx, (xmlnode *) foo, (xmlnode *)

foo_data);foo = XmlDomAppendChild(xctx, quux, foo);

Page 10: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

Fast XSLT with Oracle XDK10g

XSLT Compiler and VM for C/C++– Compile Stylesheets for execution in XSLTVM– Improved throughput up to 2.5x– Significant Reduction in Memory use

XSLT 2.0 Support and Optimizations in Java– Optimized Stylesheet compilation based on

XML/XSL static analysis– Indexing eliminates expensive XPath navigation– Support for Grouping, Multiple Outputs, Character

Mapping, Temp Trees and XSL functions

Page 11: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

XSLT Compiler and Virtual Machine

XMLXML

XSL

XSLTVirtual

Machine

XSLT Compiler

CSS

SVG

XML

HTML

WML

Page 12: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

Throughput Performance (KB/s)

Result File Size Oracle Oracle Oracle BrandXResult File Size Oracle Oracle Oracle BrandX XSLTVM C Java Java XSLTVM C Java Java Result File Size Oracle Oracle Oracle BrandXResult File Size Oracle Oracle Oracle BrandX XSLTVM C Java Java XSLTVM C Java Java

xslbench1xslbench1xslbench1xslbench1 1442144214421442 653653653653 103103103103 13131313

xslbench2xslbench2xslbench2xslbench2 1773177317731773 890890890890 1502150215021502 534534534534

xslbench3xslbench3xslbench3xslbench3 9813981398139813 4461446144614461 3125312531253125 928928928928

OverallOverallOverallOverall 1574157415741574 654654654654 408408408408 208208208208

Page 13: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

XSLT Compiler/VM Code Sample

xmlFile = (oratext*)argv[1]; xslFile = (oratext*)argv[2]; /* Create context ad initialize */xctx = XmlCreate(&err, (oratext *) "sample",

"data_encoding", "US-ASCII", NULL); comp = XmlXslCreateComp (xctx); vm = XmlXslVMCreate (xctx); /* Compile XSL stylesheet input file */code = XmlXslCompileFile (comp, xslFile, NULL,

XMLXSL_STRIPSPACE, &err); /* Transform XML input file */len = XmlXslGetBytecodeLength (code, &err); err = XmlXslVMSetBytecodeBuffer (vm, code, len); err = XmlXslVMTransformFile (vm, xmlFile, NULL);

Page 14: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

Efficiently Generate Large XML Docs

Print XML directly from SQL Queries Print Large XML Documents and Result Sets Easily print directly from SAX events Extends XML SQL Utility in Oracle XDK 10g Eliminates the need to create a DOM No need to create SAX handlers

Page 15: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

Efficiently Generate Large XML

SQL Query

JDBC

10g

……

XML

XSU

StartDocument

StartElement

EndElement

EndDocument

Streaming

Page 16: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

Performance Numbers

Result Set File Size Memory (MB) Time (s)Result Set File Size Memory (MB) Time (s) DOM/SAX DOM/SAXDOM/SAX DOM/SAXResult Set File Size Memory (MB) Time (s)Result Set File Size Memory (MB) Time (s) DOM/SAX DOM/SAXDOM/SAX DOM/SAX

3K Bytes3K Bytes3K Bytes3K Bytes 3.723.72/3.13/3.133535/34/34

300K Bytes300K Bytes300K Bytes300K Bytes 7.917.91/4.72/4.723838/37/37

3M Bytes3M Bytes3M Bytes3M Bytes 37.837.8/13.4/13.45454/37/37

30M Bytes30M Bytes30M Bytes30M Bytes ??/95.5/95.5<100<100/37/37

Page 17: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

SAX Print from Query Sample Code

//Open a File and Initialize connection and SAX print OutputStream out = new FileOutputStream("out.xml"); DriverManager.registerDriver(new

oracle.jdbc.driver.OracleDriver()); conn= DriverManager.getConnection(thinConn,”sh”,”sh”); XMLSAXPrintDriver sample = new XMLSAXPrintDriver(out);

//init the OracleXMLQuery OracleXMLQuery qry = new OracleXMLQuery(conn,"select * from sales");

//Print the results qry.getXMLSAX(sample); sample.flush();

Page 18: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

Streaming Single-step XML Processing

Create a stream-based XML integration app Validate and Transform XML messages in a

stream-based process Utilize Oracle Streams 10g messaging support Annotate XML Schema with mapping attributes Easily and Efficiently support multiple schemas Abstract application schema from input

schemas future-proofing your application

Page 19: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

Stream-based XML Processing

SAX SAX

Query

XMLXML

XSD

User Applications

XML Schema

Processor

Page 20: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

D E M O N S T R A T I O N

An Open-XML Streaming Business Process Application

Page 21: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

Existing DB Application Business

•PO

•Relational•Database

InterpretationValidation

Input

Page 22: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

Extending DB Application Business

•PO

•XML Relational•Database

InterpretationValidation

Input

SOAP

SOAP

SOAP

Page 23: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

Oracle 10g – The High Performance XML Platform

XSLT ProcessingXML Query ProcessingXML Caching w/HTTP security

XSLT ProcessingXML Query ProcessingXML Caching w/o security

XSLT ProcessingXML Query ProcessingXML Schema/DTD ValidationXML Caching w/ JAAS securityXML J2EE ComponentsXML Messaging & Queuing XML Data Integration

OracleASJ2EE

OracleASWebCache

OracleDBXML Database

Client

XMLStream

XMLStream

XMLStream

XMLType PersistenceXML Query ProcessingXML Schema ValidationXSLT Processing XML Messaging & Queuing

Page 24: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

Next Steps….

Recommended sessions– 40108: Making XML Technologies Easier to Use– 40255: Manipulating XML with Oracle JDeveloper

Recommended demos and/or hands-on labs– DB: Application Development: XML to the Power of SQL– AS: XML Technologies: Simplify Information Integration

See Your Business in Our Software– Visit the DEMOgrounds for a customized architectural

review, see a customized demo with Solutions Factory, or receive a personalized proposal. Visit the DEMOgrounds for more information.

Relevant web sites to visit for more information– XML Technology Center – otn.oracle.com/tech/xml

Page 25: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

Oracle XML Resources

•Oracle Technology Network• http://otn.oracle.com• Downloads, Demos, Samples, Papers• XML Support Forum

•Oracle9i XML Handbook• Covers all of Oracle XML technology• Includes XDK CD with Samples • Available today from Bookstores

Page 26: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

AQ&Q U E S T I O N SQ U E S T I O N S

A N S W E R SA N S W E R S

Page 27: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

Oracle XML Developer’s Kit 10gX M L T O T H E P O W E R O F S Q L

Page 28: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.

Reminder – please complete the OracleWorld online session survey

Thank you.

Page 29: Building High-Performance Enterprise XML Applications with Oracle Database 10g Mark Scardina Group Product Manager & XML Evangelist Oracle Corporation.