SlideShare a Scribd company logo
1 of 47
Oracle XML Database

  Design Concepts for XML
Applications That Will Perform !




                                   
                                           1
 Marco Gralike
Or a short story
  “Why XML on Disk can be
faster than XML in Memory…”




                              
                                      5
A Customer Use-Case




                      
                              6
Customer Case
Initial State
 No performance
 12.000 “Cases” / night (4 Hour Window)
 4 hours are not enough anymore
 The “XML” part “looks like it takes too long”
 Original database system version 8.1.X

Future Wishes
 The need to be able to handle 120.000 “Cases” / night
 In the near future hardware/OS from OpenVMS to
  HPUX




                                                          
                                                                  7
An overview

                                                         Memory
                                                         / DOM




          Oracle
                                     BLOB                CLOB              XMLType
      Advanced Queue




                        Validation
 Process                                    Shred Elements         Store in          Oracle
                       XML Schema
 Checks                                      Via XMLDOM           ETL Tables         Workflow
                         (JAVA)




                        Memor
                           y
                        / DOM




                                                                                                
                                                                                                        8
10.000 “Cases” (~ 10 Mb size)




                                
                                        9
How expensive are 1.000 “Cases” ?




                                    
                                            10
The Cost of Mixing Worlds




                            
                                    11
BLOB2CLOB and CLOB2XMLType




                             
                                     12
Feeding data to the database

                                  Memor
                                     y
                                  / DOM



       Oracle
                    BLOB   CLOB           XMLType
   Advanced Queue




 Why BLOB ?  XML data & PDF data
 Why CLOB ?  Conversion needed for XML handling
 Why XMLType  Needed to check XML element
  content
                XML Validation (well-formedness)




                                                    
                                                            13
Impedance Mismatch
 Different data models.
   XPath models an XML document as
    a tree while most general purpose
    programming languages
    have no native data types for a tree.
 Different programming paradigms.
   XSLT is a functional language, while Java
    is object-oriented and Perl is a procedural one.
Effect/Costs
 Unnecessary CPU and Memory Overhead
 A lot of expensive type and encoding conversions




                                                       
                                                               14
The General Rule !

If you deal with XML  Handle it via
   XML(DB)

 So if it is relational, do it the relational way…
 If XML use XQuery, or others like XPath etc…
 If you mix worlds be careful regarding
    Information loss (PK/FK  XML) ?
    Whitespace  NULL  Whitespace ?
    Impedance mismatch




                                                      
                                                              15
XML Document Validation




                          
                                  16
Validate XML Document via its XML Schema




                                           
                                                   17
Validation on content and structure

                                   Memor
                                      y
                                   / DOM


                           Validation
              Process                      Shred Elements
    XMLType             XML Schema
              Checks                        via XMLDOM
                        ( JAVA based)




 XML Schema  Validation on XML structure
              PL/SQL Wrapper with JAVA XML
  Parser




                                                            
                                                                    18
Java XML Parser




                  
                          19
XML Parsers
 Often DOM or Infoset based
 CPU intensive
 Memory intensive
 Parsing, serializing or tree traversals, happen in
  memory
 Often handle XML tree traversals only via ONE method
   It is not structured, semi-structured or unstructured
    XML content aware
   It is not very “smart” / “content aware” regarding XML
    handling based on its XML tree’s and/or XML data content




                                                               
                                                                       20
XML Schema Registration Advantages
 XML Schema will be parsed only once
 XML Schema will be cached in memory
   No additional parsing
   No additional validation


XML Document structure is known, therefore:
 No parsing is needed when loaded from disk into
  memory
 XML Object (XOB) structures can be applied
   Memory footprint is much less compared to DOM structure
   Needed specific nodes can now be handled efficiently in
    memory




                                                              
                                                                      21
XML Schema based - Query Rewrite
                                               CHAR
                                               String


                         bookstore
                                                                  VARCHAR
                                                                    String
                                                                      2
                                                                    (20)
          book                               whitepaper

  title   author   author chapter    title     author     id     paragraph


                          content              NUMBE
                                                Float
                                                 R
                                                                 content
                                                (15)

                                                               CLOB




                                                                             
                                                                                     22
XMLType – Not just a “Datatype”
Checked on
 XML Well-Formedness
   One root element
   Begin & End tags
 If XML Schema reference
   XOB methods will be used if an
    XML Schema is available
   DOM methods will be used if an
    XML Schema information is
    not available




                                     
                                             23
Some XSD Design Rules




                        
                                24
Keep XML small !
 Do not use / enforce Pretty Print if not needed
 Avoid namespace reference “Overkill”
   Most used Namespace is Leading
   Use short Namespace References
 Make XML data as “sparse” as possible
  <employee><name>Marco</name></employee>
  <employee name=“Marco”/>

 XML Data Partitioning                       Y

 Binary XML if possible                            X




                                                        
                                                                25
XML Design
 Avoid Cyclic References in XML Schemata
 For ease of Maintenance: xdb:annotations
 Is DOM validation, fidelity needed ?
 CPU: XML parsing- XML Schema validation “overhead”
  ?
 Index maintenance overhead, if implemented via disk
                                          Y

                                                    X




                                                        
                                                                26
XML Document Handling
Shredding & Storing XML




                          
                                  27
Check Total Amount




                     
                             28
XML Content




                    TABLE “A”




              TABLE “B”
                     TABLE “C”




                             
                                     29
Think in “3D” or in “Driving Table” terms
maxoccurs=“unbounded”
  Give me the <title> and <content> where <content> contains…


                                      3
                                      1
                                                      4


                                  2                        5

      X

                                          Y

                                                                 6
                              Z
                                                   x n rows




                                                                     
                                                                             30
Checking the Amount…




                       
                               31
The Effect of //                               (for a 1.000
“Cases)
Used Setup
 OpenVMS
 Version 9.2.0.5.0
 1.000 “Cases”


1) l_xpath := '//case['||i||']/amount_charged/text()' ;
2) l_xpath := '/case_data/case['||i||']/amount_charged/text()' ;
3) select
   sum(to_number(extract(value(tr),'/case_data/case/amount_charged/text()'))


All in memory: COLLECTION ITERATOR PICKLER




                                                                               
                                                                                       32
  FETCH
CLOB XMLType (V 11.1.0.6.0)




         ORA-31186




                              
                                      33
Increasing volume – XMLType CLOB
 Effect of //
 In memory
 10.000 Cases:
   ORA-31186
    Document contains too
    many nodes
   maxoccurs=unbounded
 maxLength, totalDigits, etc
  ORA-31186:   Document contains too many nodes
  Cause:       Unable to load the document because it has exceeded
               the maximum allocated number of DOM nodes.
  Action:      Reduces the size of the document




                                                                     
                                                                             34
XML Document Handling
Object Relational, Binary XML




                                
                                        35
A Solution based on XMLType O.R.



          Oracle
                                     BLOB         CLOB
      Advanced Queue




                        Validation
       XMLType Table                  Store in              Oracle
                         Against                   Checks
          (O.R)                      ETL Tables             Workflow
                       XML Schema




                              Rewrite on Disk
                                  / XOB
                               (Relational)




                                                                       
                                                                               36
Driving Access on CONTENT                                        (…on disk…)
                                                     BTree
                                                      BTre
                                                       BTre
                                                     Index
                                                      ee
                                                      Index
                                                       Index
                              bookstore
                                                                             Function
                                                                            based Index
                                                                              (XPath)
         book                                       whitepaper

 title   author   author chapter            title     author           id   paragraph
            (Un)-Structured
              XMLIndex
                               content                                      structured
                                                                             content
                                                               BTree
                              Secondary                        Index
                              Oracle Text
                                Index




                                                                                          
                                                                                                  37
Cost Based Optimizer Advantages
 Can be influenced via
     Statistics
     Indexes
     XML Schema Registration (XOB)
     Encoding in Binary XML storage


 SQL Re-Write of XPath, XQuery
 Partitioning




                                       
                                               38
O.R. XMLType (V 11.1.0.6.0)




                 ORA-31186
                              ORA-31186




                                          
                                                  39
So why can DISK out perform MEMORY
 XML Schema validation based on Registered XML
  Schema
 Query re-write possible
   Based on plain “old” SQL/database methods
 Optimized CPU handling
 Optimized Memory handling (if needed)
 Multiple optimized solutions possible via Optimizer
  instead of one XML parser method
 Specific parts of XML can be handled / be driven via:
   specific indexing
   or content
 Full blown validation can be avoided




                                                          
                                                                  40
Recap…




         
                 41
Be aware of what you are doing !
 Avoid unneeded (full) XML Schema validation
   During Insert
   Generating XML
 Avoid Impedance mismatch
   Java  XML  Java  XML  Relational  XML  Java
   “All In One Go Objective”
 Avoid intermediate XML fragments
     //                                   Y

     XMLEXISTS                                         X
     Use Indexes
     xdb:MaintainDOM=false




                                                            
                                                                    42
XML Data Handling and Design
 Handle XML Smart
 Keep XML Small
 Restrict XML where possible
   Be precise !
   maxoccurs, maxLength
 Provide Oracle of extra / precise information (XSD)
 Register XML Schema
                                             Y
   If possible…
                                                        X




                                                            
                                                                    43
Balanced Design
 Inserts, Updates & Deletes
                                   In
    XML Future Changes          Memory
                                          On Disk
    Index Maintenance
 Selects
    In Memory
    Via Indexes
 XML Validation
    Strict, Lazy
    Client Side Possibilities




                                                    
                                                            44
Now you why DISK can be faster than MEMORY
 100.000 “Cases” shredded & validated in 5 minutes
   Instead of 1000 “Cases” in 3 minutes…
 Avoiding
   ORA-31186: Document contains too many nodes
 Scalable
   Efficient with Memory and CPU
 Checked in production on a 9.2.0.5.0 database version

Extra:
 …decreased used PL/SQL code by half…
 …but will have to KNOW what you are doing…




                                                          
                                                                  45
46





References
XMLDB Developers Guide
   http://www.oracle.com/pls/db112/homepage
The XMLDB Forum
   http://forums.oracle.com/forums/forum.jspa?forumID=34
XML DB FAQ Thread
   http://forums.oracle.com/forums/thread.jspa?threadID=410714

Blog
   http://www.xmldb.nl




                                                              
                                                                      47

More Related Content

What's hot

UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server
UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File ServerUKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server
UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File ServerMarco Gralike
 
Design Concepts For Xml Applications That Will Perform
Design Concepts For Xml Applications That Will PerformDesign Concepts For Xml Applications That Will Perform
Design Concepts For Xml Applications That Will PerformMarco Gralike
 
XML In The Real World - Use Cases For Oracle XMLDB
XML In The Real World - Use Cases For Oracle XMLDBXML In The Real World - Use Cases For Oracle XMLDB
XML In The Real World - Use Cases For Oracle XMLDBMarco Gralike
 
Miracle Open World 2011 - XML Index Strategies
Miracle Open World 2011  -  XML Index StrategiesMiracle Open World 2011  -  XML Index Strategies
Miracle Open World 2011 - XML Index StrategiesMarco Gralike
 
Ogh Ace Case, Part 1 and 2, Oracle Xml Database, Marco Gralike
Ogh Ace Case, Part 1 and 2, Oracle Xml Database, Marco GralikeOgh Ace Case, Part 1 and 2, Oracle Xml Database, Marco Gralike
Ogh Ace Case, Part 1 and 2, Oracle Xml Database, Marco GralikeMarco Gralike
 
UKOUG 2010 (Birmingham) - XML Indexing strategies - Choosing the Right Index ...
UKOUG 2010 (Birmingham) - XML Indexing strategies - Choosing the Right Index ...UKOUG 2010 (Birmingham) - XML Indexing strategies - Choosing the Right Index ...
UKOUG 2010 (Birmingham) - XML Indexing strategies - Choosing the Right Index ...Marco Gralike
 
Oracle Database 11g Release 2 - XMLDB New Features
Oracle Database 11g Release 2 - XMLDB New FeaturesOracle Database 11g Release 2 - XMLDB New Features
Oracle Database 11g Release 2 - XMLDB New FeaturesMarco Gralike
 
Oracle Developer Day, 20 October 2009, Oracle De Meern, Holland: Oracle Datab...
Oracle Developer Day, 20 October 2009, Oracle De Meern, Holland: Oracle Datab...Oracle Developer Day, 20 October 2009, Oracle De Meern, Holland: Oracle Datab...
Oracle Developer Day, 20 October 2009, Oracle De Meern, Holland: Oracle Datab...Marco Gralike
 
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...Marco Gralike
 
OakTable World 2015 - Using XMLType content with the Oracle In-Memory Column...
OakTable World 2015  - Using XMLType content with the Oracle In-Memory Column...OakTable World 2015  - Using XMLType content with the Oracle In-Memory Column...
OakTable World 2015 - Using XMLType content with the Oracle In-Memory Column...Marco Gralike
 
XMLDB Building Blocks And Best Practices - Oracle Open World 2008 - Marco Gra...
XMLDB Building Blocks And Best Practices - Oracle Open World 2008 - Marco Gra...XMLDB Building Blocks And Best Practices - Oracle Open World 2008 - Marco Gra...
XMLDB Building Blocks And Best Practices - Oracle Open World 2008 - Marco Gra...Marco Gralike
 
UKOUG Tech14 - Using Database In-Memory Column Store with Complex Datatypes
UKOUG Tech14 - Using Database In-Memory Column Store with Complex DatatypesUKOUG Tech14 - Using Database In-Memory Column Store with Complex Datatypes
UKOUG Tech14 - Using Database In-Memory Column Store with Complex DatatypesMarco Gralike
 
Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...
Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...
Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...InSync2011
 
Ordina Oracle Open World
Ordina Oracle Open WorldOrdina Oracle Open World
Ordina Oracle Open WorldMarco Gralike
 
Expertezed 2012 Webcast - XML DB Use Cases
Expertezed 2012 Webcast - XML DB Use CasesExpertezed 2012 Webcast - XML DB Use Cases
Expertezed 2012 Webcast - XML DB Use CasesMarco Gralike
 
Starting with JSON Path Expressions in Oracle 12.1.0.2
Starting with JSON Path Expressions in Oracle 12.1.0.2Starting with JSON Path Expressions in Oracle 12.1.0.2
Starting with JSON Path Expressions in Oracle 12.1.0.2Marco Gralike
 
Advanced SQL - Database Access from Programming Languages
Advanced SQL - Database Access  from Programming LanguagesAdvanced SQL - Database Access  from Programming Languages
Advanced SQL - Database Access from Programming LanguagesS.Shayan Daneshvar
 

What's hot (20)

UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server
UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File ServerUKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server
UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server
 
Design Concepts For Xml Applications That Will Perform
Design Concepts For Xml Applications That Will PerformDesign Concepts For Xml Applications That Will Perform
Design Concepts For Xml Applications That Will Perform
 
XML In The Real World - Use Cases For Oracle XMLDB
XML In The Real World - Use Cases For Oracle XMLDBXML In The Real World - Use Cases For Oracle XMLDB
XML In The Real World - Use Cases For Oracle XMLDB
 
Miracle Open World 2011 - XML Index Strategies
Miracle Open World 2011  -  XML Index StrategiesMiracle Open World 2011  -  XML Index Strategies
Miracle Open World 2011 - XML Index Strategies
 
Ogh Ace Case, Part 1 and 2, Oracle Xml Database, Marco Gralike
Ogh Ace Case, Part 1 and 2, Oracle Xml Database, Marco GralikeOgh Ace Case, Part 1 and 2, Oracle Xml Database, Marco Gralike
Ogh Ace Case, Part 1 and 2, Oracle Xml Database, Marco Gralike
 
UKOUG 2010 (Birmingham) - XML Indexing strategies - Choosing the Right Index ...
UKOUG 2010 (Birmingham) - XML Indexing strategies - Choosing the Right Index ...UKOUG 2010 (Birmingham) - XML Indexing strategies - Choosing the Right Index ...
UKOUG 2010 (Birmingham) - XML Indexing strategies - Choosing the Right Index ...
 
Oracle Database 11g Release 2 - XMLDB New Features
Oracle Database 11g Release 2 - XMLDB New FeaturesOracle Database 11g Release 2 - XMLDB New Features
Oracle Database 11g Release 2 - XMLDB New Features
 
Oracle Developer Day, 20 October 2009, Oracle De Meern, Holland: Oracle Datab...
Oracle Developer Day, 20 October 2009, Oracle De Meern, Holland: Oracle Datab...Oracle Developer Day, 20 October 2009, Oracle De Meern, Holland: Oracle Datab...
Oracle Developer Day, 20 October 2009, Oracle De Meern, Holland: Oracle Datab...
 
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
 
OakTable World 2015 - Using XMLType content with the Oracle In-Memory Column...
OakTable World 2015  - Using XMLType content with the Oracle In-Memory Column...OakTable World 2015  - Using XMLType content with the Oracle In-Memory Column...
OakTable World 2015 - Using XMLType content with the Oracle In-Memory Column...
 
XMLDB Building Blocks And Best Practices - Oracle Open World 2008 - Marco Gra...
XMLDB Building Blocks And Best Practices - Oracle Open World 2008 - Marco Gra...XMLDB Building Blocks And Best Practices - Oracle Open World 2008 - Marco Gra...
XMLDB Building Blocks And Best Practices - Oracle Open World 2008 - Marco Gra...
 
UKOUG Tech14 - Using Database In-Memory Column Store with Complex Datatypes
UKOUG Tech14 - Using Database In-Memory Column Store with Complex DatatypesUKOUG Tech14 - Using Database In-Memory Column Store with Complex Datatypes
UKOUG Tech14 - Using Database In-Memory Column Store with Complex Datatypes
 
Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...
Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...
Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...
 
Ordina Oracle Open World
Ordina Oracle Open WorldOrdina Oracle Open World
Ordina Oracle Open World
 
Expertezed 2012 Webcast - XML DB Use Cases
Expertezed 2012 Webcast - XML DB Use CasesExpertezed 2012 Webcast - XML DB Use Cases
Expertezed 2012 Webcast - XML DB Use Cases
 
Xml processors
Xml processorsXml processors
Xml processors
 
Java full stack1
Java full stack1Java full stack1
Java full stack1
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Starting with JSON Path Expressions in Oracle 12.1.0.2
Starting with JSON Path Expressions in Oracle 12.1.0.2Starting with JSON Path Expressions in Oracle 12.1.0.2
Starting with JSON Path Expressions in Oracle 12.1.0.2
 
Advanced SQL - Database Access from Programming Languages
Advanced SQL - Database Access  from Programming LanguagesAdvanced SQL - Database Access  from Programming Languages
Advanced SQL - Database Access from Programming Languages
 

Similar to BGOUG 2012 - Design concepts for xml applications that will perform

SD Forum 1999 XML Lessons Learned
SD Forum 1999 XML Lessons LearnedSD Forum 1999 XML Lessons Learned
SD Forum 1999 XML Lessons LearnedTed Leung
 
JSR-222 Java Architecture for XML Binding
JSR-222 Java Architecture for XML BindingJSR-222 Java Architecture for XML Binding
JSR-222 Java Architecture for XML BindingHeiko Scherrer
 
IBM Solutions '99 XML and Java: Lessons Learned
IBM Solutions '99 XML and Java: Lessons LearnedIBM Solutions '99 XML and Java: Lessons Learned
IBM Solutions '99 XML and Java: Lessons LearnedTed Leung
 
Parsing XML & JSON in Apex
Parsing XML & JSON in ApexParsing XML & JSON in Apex
Parsing XML & JSON in ApexAbhinav Gupta
 
Jaxp Xmltutorial 11 200108
Jaxp Xmltutorial 11 200108Jaxp Xmltutorial 11 200108
Jaxp Xmltutorial 11 200108nit Allahabad
 
Xml processing-by-asfak
Xml processing-by-asfakXml processing-by-asfak
Xml processing-by-asfakAsfak Mahamud
 
Understanding Dom
Understanding DomUnderstanding Dom
Understanding DomLiquidHub
 
Xml serialization
Xml serializationXml serialization
Xml serializationRaghu nath
 
Ch23 xml processing_with_java
Ch23 xml processing_with_javaCh23 xml processing_with_java
Ch23 xml processing_with_javaardnetij
 
unit_5_XML data integration database management
unit_5_XML data integration database managementunit_5_XML data integration database management
unit_5_XML data integration database managementsathiyabcsbs
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Espen Brækken
 
Efficient processing of large and complex XML documents in Hadoop
Efficient processing of large and complex XML documents in HadoopEfficient processing of large and complex XML documents in Hadoop
Efficient processing of large and complex XML documents in HadoopDataWorks Summit
 
Building XML Based Applications
Building XML Based ApplicationsBuilding XML Based Applications
Building XML Based ApplicationsPrabu U
 
Extbase object to xml mapping
Extbase object to xml mappingExtbase object to xml mapping
Extbase object to xml mappingThomas Maroschik
 
HadoopXML: A Suite for Parallel Processing of Massive XML Data with Multiple ...
HadoopXML: A Suite for Parallel Processing of Massive XML Data with Multiple ...HadoopXML: A Suite for Parallel Processing of Massive XML Data with Multiple ...
HadoopXML: A Suite for Parallel Processing of Massive XML Data with Multiple ...Kyong-Ha Lee
 
Mashups with Drupal and QueryPath
Mashups with Drupal and QueryPathMashups with Drupal and QueryPath
Mashups with Drupal and QueryPathMatt Butcher
 
Understanding Sax
Understanding SaxUnderstanding Sax
Understanding SaxLiquidHub
 
SQLPASS AD501-M XQuery MRys
SQLPASS AD501-M XQuery MRysSQLPASS AD501-M XQuery MRys
SQLPASS AD501-M XQuery MRysMichael Rys
 

Similar to BGOUG 2012 - Design concepts for xml applications that will perform (20)

SD Forum 1999 XML Lessons Learned
SD Forum 1999 XML Lessons LearnedSD Forum 1999 XML Lessons Learned
SD Forum 1999 XML Lessons Learned
 
JSR-222 Java Architecture for XML Binding
JSR-222 Java Architecture for XML BindingJSR-222 Java Architecture for XML Binding
JSR-222 Java Architecture for XML Binding
 
IBM Solutions '99 XML and Java: Lessons Learned
IBM Solutions '99 XML and Java: Lessons LearnedIBM Solutions '99 XML and Java: Lessons Learned
IBM Solutions '99 XML and Java: Lessons Learned
 
Parsing XML & JSON in Apex
Parsing XML & JSON in ApexParsing XML & JSON in Apex
Parsing XML & JSON in Apex
 
Jaxp Xmltutorial 11 200108
Jaxp Xmltutorial 11 200108Jaxp Xmltutorial 11 200108
Jaxp Xmltutorial 11 200108
 
Xml processing-by-asfak
Xml processing-by-asfakXml processing-by-asfak
Xml processing-by-asfak
 
Understanding Dom
Understanding DomUnderstanding Dom
Understanding Dom
 
Xml serialization
Xml serializationXml serialization
Xml serialization
 
Ch23
Ch23Ch23
Ch23
 
Ch23 xml processing_with_java
Ch23 xml processing_with_javaCh23 xml processing_with_java
Ch23 xml processing_with_java
 
unit_5_XML data integration database management
unit_5_XML data integration database managementunit_5_XML data integration database management
unit_5_XML data integration database management
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex
 
XML Bible
XML BibleXML Bible
XML Bible
 
Efficient processing of large and complex XML documents in Hadoop
Efficient processing of large and complex XML documents in HadoopEfficient processing of large and complex XML documents in Hadoop
Efficient processing of large and complex XML documents in Hadoop
 
Building XML Based Applications
Building XML Based ApplicationsBuilding XML Based Applications
Building XML Based Applications
 
Extbase object to xml mapping
Extbase object to xml mappingExtbase object to xml mapping
Extbase object to xml mapping
 
HadoopXML: A Suite for Parallel Processing of Massive XML Data with Multiple ...
HadoopXML: A Suite for Parallel Processing of Massive XML Data with Multiple ...HadoopXML: A Suite for Parallel Processing of Massive XML Data with Multiple ...
HadoopXML: A Suite for Parallel Processing of Massive XML Data with Multiple ...
 
Mashups with Drupal and QueryPath
Mashups with Drupal and QueryPathMashups with Drupal and QueryPath
Mashups with Drupal and QueryPath
 
Understanding Sax
Understanding SaxUnderstanding Sax
Understanding Sax
 
SQLPASS AD501-M XQuery MRys
SQLPASS AD501-M XQuery MRysSQLPASS AD501-M XQuery MRys
SQLPASS AD501-M XQuery MRys
 

More from Marco Gralike

UKOUG2018 - I Know what you did Last Summer [in my Database].pptx
UKOUG2018 - I Know what you did Last Summer [in my Database].pptxUKOUG2018 - I Know what you did Last Summer [in my Database].pptx
UKOUG2018 - I Know what you did Last Summer [in my Database].pptxMarco Gralike
 
eProseed Oracle Open World 2016 debrief - Oracle Management Cloud
eProseed Oracle Open World 2016 debrief - Oracle Management CloudeProseed Oracle Open World 2016 debrief - Oracle Management Cloud
eProseed Oracle Open World 2016 debrief - Oracle Management CloudMarco Gralike
 
eProseed Oracle Open World 2016 debrief - Oracle 12.2.0.1 Database
eProseed Oracle Open World 2016 debrief - Oracle 12.2.0.1 DatabaseeProseed Oracle Open World 2016 debrief - Oracle 12.2.0.1 Database
eProseed Oracle Open World 2016 debrief - Oracle 12.2.0.1 DatabaseMarco Gralike
 
Oracle Database - JSON and the In-Memory Database
Oracle Database - JSON and the In-Memory DatabaseOracle Database - JSON and the In-Memory Database
Oracle Database - JSON and the In-Memory DatabaseMarco Gralike
 
UKOUG Tech15 - Going Full Circle - Building a native JSON Database API
UKOUG Tech15 - Going Full Circle - Building a native JSON Database APIUKOUG Tech15 - Going Full Circle - Building a native JSON Database API
UKOUG Tech15 - Going Full Circle - Building a native JSON Database APIMarco Gralike
 
UKOUG Tech14 - Getting Started With JSON in the Database
UKOUG Tech14 - Getting Started With JSON in the DatabaseUKOUG Tech14 - Getting Started With JSON in the Database
UKOUG Tech14 - Getting Started With JSON in the DatabaseMarco Gralike
 
An introduction into Oracle VM V3.x
An introduction into Oracle VM V3.xAn introduction into Oracle VM V3.x
An introduction into Oracle VM V3.xMarco Gralike
 
An introduction into Oracle Enterprise Manager Cloud Control 12c Release 3
An introduction into Oracle Enterprise Manager Cloud Control 12c Release 3An introduction into Oracle Enterprise Manager Cloud Control 12c Release 3
An introduction into Oracle Enterprise Manager Cloud Control 12c Release 3Marco Gralike
 
An AMIS Overview of Oracle database 12c (12.1)
An AMIS Overview of Oracle database 12c (12.1)An AMIS Overview of Oracle database 12c (12.1)
An AMIS Overview of Oracle database 12c (12.1)Marco Gralike
 
Flexibiliteit & Snel Schakelen
Flexibiliteit & Snel SchakelenFlexibiliteit & Snel Schakelen
Flexibiliteit & Snel SchakelenMarco Gralike
 

More from Marco Gralike (11)

UKOUG2018 - I Know what you did Last Summer [in my Database].pptx
UKOUG2018 - I Know what you did Last Summer [in my Database].pptxUKOUG2018 - I Know what you did Last Summer [in my Database].pptx
UKOUG2018 - I Know what you did Last Summer [in my Database].pptx
 
eProseed Oracle Open World 2016 debrief - Oracle Management Cloud
eProseed Oracle Open World 2016 debrief - Oracle Management CloudeProseed Oracle Open World 2016 debrief - Oracle Management Cloud
eProseed Oracle Open World 2016 debrief - Oracle Management Cloud
 
eProseed Oracle Open World 2016 debrief - Oracle 12.2.0.1 Database
eProseed Oracle Open World 2016 debrief - Oracle 12.2.0.1 DatabaseeProseed Oracle Open World 2016 debrief - Oracle 12.2.0.1 Database
eProseed Oracle Open World 2016 debrief - Oracle 12.2.0.1 Database
 
Oracle Database - JSON and the In-Memory Database
Oracle Database - JSON and the In-Memory DatabaseOracle Database - JSON and the In-Memory Database
Oracle Database - JSON and the In-Memory Database
 
UKOUG Tech15 - Going Full Circle - Building a native JSON Database API
UKOUG Tech15 - Going Full Circle - Building a native JSON Database APIUKOUG Tech15 - Going Full Circle - Building a native JSON Database API
UKOUG Tech15 - Going Full Circle - Building a native JSON Database API
 
UKOUG Tech14 - Getting Started With JSON in the Database
UKOUG Tech14 - Getting Started With JSON in the DatabaseUKOUG Tech14 - Getting Started With JSON in the Database
UKOUG Tech14 - Getting Started With JSON in the Database
 
An introduction into Oracle VM V3.x
An introduction into Oracle VM V3.xAn introduction into Oracle VM V3.x
An introduction into Oracle VM V3.x
 
An introduction into Oracle Enterprise Manager Cloud Control 12c Release 3
An introduction into Oracle Enterprise Manager Cloud Control 12c Release 3An introduction into Oracle Enterprise Manager Cloud Control 12c Release 3
An introduction into Oracle Enterprise Manager Cloud Control 12c Release 3
 
An AMIS Overview of Oracle database 12c (12.1)
An AMIS Overview of Oracle database 12c (12.1)An AMIS Overview of Oracle database 12c (12.1)
An AMIS Overview of Oracle database 12c (12.1)
 
Flexibiliteit & Snel Schakelen
Flexibiliteit & Snel SchakelenFlexibiliteit & Snel Schakelen
Flexibiliteit & Snel Schakelen
 
Amis ACE
Amis ACEAmis ACE
Amis ACE
 

Recently uploaded

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 

Recently uploaded (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 

BGOUG 2012 - Design concepts for xml applications that will perform

  • 1. Oracle XML Database Design Concepts for XML Applications That Will Perform !  1 Marco Gralike
  • 2.
  • 3.
  • 4.
  • 5. Or a short story “Why XML on Disk can be faster than XML in Memory…”  5
  • 6. A Customer Use-Case  6
  • 7. Customer Case Initial State  No performance  12.000 “Cases” / night (4 Hour Window)  4 hours are not enough anymore  The “XML” part “looks like it takes too long”  Original database system version 8.1.X Future Wishes  The need to be able to handle 120.000 “Cases” / night  In the near future hardware/OS from OpenVMS to HPUX  7
  • 8. An overview Memory / DOM Oracle BLOB CLOB XMLType Advanced Queue Validation Process Shred Elements Store in Oracle XML Schema Checks Via XMLDOM ETL Tables Workflow (JAVA) Memor y / DOM  8
  • 9. 10.000 “Cases” (~ 10 Mb size)  9
  • 10. How expensive are 1.000 “Cases” ?  10
  • 11. The Cost of Mixing Worlds  11
  • 12. BLOB2CLOB and CLOB2XMLType  12
  • 13. Feeding data to the database Memor y / DOM Oracle BLOB CLOB XMLType Advanced Queue  Why BLOB ?  XML data & PDF data  Why CLOB ?  Conversion needed for XML handling  Why XMLType  Needed to check XML element content XML Validation (well-formedness)  13
  • 14. Impedance Mismatch  Different data models.  XPath models an XML document as a tree while most general purpose programming languages have no native data types for a tree.  Different programming paradigms.  XSLT is a functional language, while Java is object-oriented and Perl is a procedural one. Effect/Costs  Unnecessary CPU and Memory Overhead  A lot of expensive type and encoding conversions  14
  • 15. The General Rule ! If you deal with XML  Handle it via XML(DB)  So if it is relational, do it the relational way…  If XML use XQuery, or others like XPath etc…  If you mix worlds be careful regarding  Information loss (PK/FK  XML) ?  Whitespace  NULL  Whitespace ?  Impedance mismatch  15
  • 16. XML Document Validation  16
  • 17. Validate XML Document via its XML Schema  17
  • 18. Validation on content and structure Memor y / DOM Validation Process Shred Elements XMLType XML Schema Checks via XMLDOM ( JAVA based)  XML Schema  Validation on XML structure  PL/SQL Wrapper with JAVA XML Parser  18
  • 19. Java XML Parser  19
  • 20. XML Parsers  Often DOM or Infoset based  CPU intensive  Memory intensive  Parsing, serializing or tree traversals, happen in memory  Often handle XML tree traversals only via ONE method  It is not structured, semi-structured or unstructured XML content aware  It is not very “smart” / “content aware” regarding XML handling based on its XML tree’s and/or XML data content  20
  • 21. XML Schema Registration Advantages  XML Schema will be parsed only once  XML Schema will be cached in memory  No additional parsing  No additional validation XML Document structure is known, therefore:  No parsing is needed when loaded from disk into memory  XML Object (XOB) structures can be applied  Memory footprint is much less compared to DOM structure  Needed specific nodes can now be handled efficiently in memory  21
  • 22. XML Schema based - Query Rewrite CHAR String bookstore VARCHAR String 2 (20) book whitepaper title author author chapter title author id paragraph content NUMBE Float R content (15) CLOB  22
  • 23. XMLType – Not just a “Datatype” Checked on  XML Well-Formedness  One root element  Begin & End tags  If XML Schema reference  XOB methods will be used if an XML Schema is available  DOM methods will be used if an XML Schema information is not available  23
  • 24. Some XSD Design Rules  24
  • 25. Keep XML small !  Do not use / enforce Pretty Print if not needed  Avoid namespace reference “Overkill”  Most used Namespace is Leading  Use short Namespace References  Make XML data as “sparse” as possible <employee><name>Marco</name></employee> <employee name=“Marco”/>  XML Data Partitioning Y  Binary XML if possible X  25
  • 26. XML Design  Avoid Cyclic References in XML Schemata  For ease of Maintenance: xdb:annotations  Is DOM validation, fidelity needed ?  CPU: XML parsing- XML Schema validation “overhead” ?  Index maintenance overhead, if implemented via disk Y X  26
  • 27. XML Document Handling Shredding & Storing XML  27
  • 28. Check Total Amount  28
  • 29. XML Content TABLE “A” TABLE “B” TABLE “C”  29
  • 30. Think in “3D” or in “Driving Table” terms maxoccurs=“unbounded”  Give me the <title> and <content> where <content> contains… 3 1 4 2 5 X Y 6 Z x n rows  30
  • 31. Checking the Amount…  31
  • 32. The Effect of // (for a 1.000 “Cases) Used Setup OpenVMS Version 9.2.0.5.0 1.000 “Cases” 1) l_xpath := '//case['||i||']/amount_charged/text()' ; 2) l_xpath := '/case_data/case['||i||']/amount_charged/text()' ; 3) select sum(to_number(extract(value(tr),'/case_data/case/amount_charged/text()')) All in memory: COLLECTION ITERATOR PICKLER  32 FETCH
  • 33. CLOB XMLType (V 11.1.0.6.0) ORA-31186  33
  • 34. Increasing volume – XMLType CLOB  Effect of //  In memory  10.000 Cases:  ORA-31186 Document contains too many nodes  maxoccurs=unbounded  maxLength, totalDigits, etc ORA-31186: Document contains too many nodes Cause: Unable to load the document because it has exceeded the maximum allocated number of DOM nodes. Action: Reduces the size of the document  34
  • 35. XML Document Handling Object Relational, Binary XML  35
  • 36. A Solution based on XMLType O.R. Oracle BLOB CLOB Advanced Queue Validation XMLType Table Store in Oracle Against Checks (O.R) ETL Tables Workflow XML Schema Rewrite on Disk / XOB (Relational)  36
  • 37. Driving Access on CONTENT (…on disk…) BTree BTre BTre Index ee Index Index bookstore Function based Index (XPath) book whitepaper title author author chapter title author id paragraph (Un)-Structured XMLIndex content structured content BTree Secondary Index Oracle Text Index  37
  • 38. Cost Based Optimizer Advantages  Can be influenced via  Statistics  Indexes  XML Schema Registration (XOB)  Encoding in Binary XML storage  SQL Re-Write of XPath, XQuery  Partitioning  38
  • 39. O.R. XMLType (V 11.1.0.6.0) ORA-31186 ORA-31186  39
  • 40. So why can DISK out perform MEMORY  XML Schema validation based on Registered XML Schema  Query re-write possible  Based on plain “old” SQL/database methods  Optimized CPU handling  Optimized Memory handling (if needed)  Multiple optimized solutions possible via Optimizer instead of one XML parser method  Specific parts of XML can be handled / be driven via:  specific indexing  or content  Full blown validation can be avoided  40
  • 41. Recap…  41
  • 42. Be aware of what you are doing !  Avoid unneeded (full) XML Schema validation  During Insert  Generating XML  Avoid Impedance mismatch  Java  XML  Java  XML  Relational  XML  Java  “All In One Go Objective”  Avoid intermediate XML fragments  // Y  XMLEXISTS X  Use Indexes  xdb:MaintainDOM=false  42
  • 43. XML Data Handling and Design  Handle XML Smart  Keep XML Small  Restrict XML where possible  Be precise !  maxoccurs, maxLength  Provide Oracle of extra / precise information (XSD)  Register XML Schema Y  If possible… X  43
  • 44. Balanced Design  Inserts, Updates & Deletes In  XML Future Changes Memory On Disk  Index Maintenance  Selects  In Memory  Via Indexes  XML Validation  Strict, Lazy  Client Side Possibilities  44
  • 45. Now you why DISK can be faster than MEMORY  100.000 “Cases” shredded & validated in 5 minutes  Instead of 1000 “Cases” in 3 minutes…  Avoiding  ORA-31186: Document contains too many nodes  Scalable  Efficient with Memory and CPU  Checked in production on a 9.2.0.5.0 database version Extra:  …decreased used PL/SQL code by half…  …but will have to KNOW what you are doing…  45
  • 47. References XMLDB Developers Guide  http://www.oracle.com/pls/db112/homepage The XMLDB Forum  http://forums.oracle.com/forums/forum.jspa?forumID=34 XML DB FAQ Thread  http://forums.oracle.com/forums/thread.jspa?threadID=410714 Blog  http://www.xmldb.nl  47