Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Programming IT Technology

Simplify Apps Using XML With PHP and DB2 26

An anonymous reader writes "IBM DeveloperWorks has an article from a little while back that takes a look at the impact of schema evolution on the application. The narrative walks the reader through a usage scenario to illustrate the ease of setting up a PHP environment and integrating DB2 native XML functionality with PHP applications including web services written in PHP and XQuery."
This discussion has been archived. No new comments can be posted.

Simplify Apps Using XML With PHP and DB2

Comments Filter:
  • So... (Score:5, Informative)

    by Crayon Kid ( 700279 ) on Wednesday November 16, 2005 @04:46AM (#14042130)
    ...they implemented "XML databases" by treating XML as BLOB's and adding XML parsing and updating capabilities to SQL. Hybrid indeed. I'd be rather tempted to call it a bastardization of both contepts (relational and XML).

    The thought springs to mind that PHP, as it happens, would be uniquely suited to working with the hypotethical XML databases, due to it's rather particular concept of arrays. As many of us undoubtely know, a PHP array can be used to contain a tree of arbitrary shape and size, and with nodes of arbitrary types. A native, 1-on-1 match to an XML tree.

    A couple of years ago I tried looking for a native XML database. The solutions were either very pricey, or very slow, or both. Nothing to keep up to RDBMS. The whole "XMLDBMS" hype died over eventually, as you may recall. OR hasn't it? Are such hybrid solutions all that's left of the concept? It was a great idea.
    • Re:So... (Score:4, Insightful)

      by hey! ( 33014 ) on Wednesday November 16, 2005 @07:13AM (#14042512) Homepage Journal
      ...they implemented "XML databases" by treating XML as BLOB's and adding XML parsing and updating capabilities to SQL. Hybrid indeed. I'd be rather tempted to call it a bastardization of both contepts (relational and XML).

      The problem lies not in our parsers, but in our application domains -- and ourselves.

      It is trivial to represent flat data structures (or sets of tuples if you prefer) using XML. It isn't hard at all to represent hierarchical or even irregularly structured data using SQL. What's hard is doing any useful processing of data after you've chosen a format whose associated tools don't readily do what you need to do with that data.

      It's hard to tighten nuts with a hammer or drive nails with a wrench.

      A hybrid tool certainly has it's potential uses in an application that crosses domain boundaries. Such applications are inherently hard in any case; it's not as simple as choosing a wrench or a hammer, it takes expereince. But this is greatly complicated engineers who will invariably choose the wrong tool (often XML these days), who given a hybrid hammer/wrench tool will insist on always hitting things with the wrench.

      To be sure there are borderline cases, but you need to solve the problem with the minimal number of parts.
    • A couple of years ago I tried looking for a native XML database. The solutions were either very pricey, or very slow, or both. Nothing to keep up to RDBMS. The whole "XMLDBMS" hype died over eventually, as you may recall. OR hasn't it? Are such hybrid solutions all that's left of the concept? It was a great idea.

      It wasn't so much a great idea as an exceedingly obvious one which no-one has managed to pick up on.

      In my humble opinion, XML is essentially crippled without some kind of query/search/XML-Database f
      • the FOSS community in paticular has dropped the ball on XQuery applications.

        And rightly so, because it's crap. Since XML has no regular structure, any XQuery involves a linear scan. Unless some sound theory behind XQuery is discovered and a way to index XML documents, XQuery is useless.

        Berkeley DB XML claims to index XML documents. I tested it on a large document. A trivial query took a GB of memory without returning anything but an error. What's the point of this "technology"? It should have been giv
    • The server-side RSS aggregator I use (magpierss [sourceforge.net]) does exactly this. It reads the blog feed, which is effectively a teeny database, and then indexes into the associative array to find the different elements.
    • The thought springs to mind that PHP, as it happens, would be uniquely suited to working with the hypotethical XML databases, due to it's rather particular concept of arrays. As many of us undoubtely know, a PHP array can be used to contain a tree of arbitrary shape and size, and with nodes of arbitrary types. A native, 1-on-1 match to an XML tree.

      Indeed this is trivial to acheive using PHP's XML functions (expat, not SimpleXML). However, since you have to parse the entire XML file in a linear manner anyway
    • The thought springs to mind that PHP, as it happens, would be uniquely suited to working with the hypotethical XML databases, due to its rather particular concept of arrays. As many of us undoubtely know, a PHP array can be used to contain a tree of arbitrary shape and size, and with nodes of arbitrary types. A native, 1-on-1 match to an XML tree.

      Welcome to post-relational, multi-dimensional databases! The wave of the future! Purchase Caché today!

      [Caché is the latest in a long line of M/Mumps 'glo
  • by YA_Python_dev ( 885173 ) on Wednesday November 16, 2005 @06:14AM (#14042352) Journal
    XML is not the answer. It is not even the question. To paraphrase Jamie Zawinski on regular expressions [pastiche.org], "Some people, when confronted with a problem, think "I know, I'll use XML." Now they have two problems."
    -- Phillip J. Eby [dirtsimple.org]

    Granted, he was talking about Python, not PHP... but still...

  • c'mon (Score:1, Flamebait)

    xml and db2 tend to complicate things more than simplify them
  • From the article:

    Note: An assumption we are making for this scenario is that the business data is already in XML, even if the database might not have any XML capabilities.

    Bogometer Pegged!

    If they had made the opposite assumption (that the business data was not in XML format, a much more common scenario), then, the added complexity of translating the data to an XML format would have made the non-DB2 approach look cleaner and more reasonable.

  • Simplify, DB2 and XML in one sentence. This is odd.
  • Funny... (Score:3, Funny)

    by __aaclcg7560 ( 824291 ) on Wednesday November 16, 2005 @03:56PM (#14047042)
    I thought AJAX was the latest alphabet soup fad of the month. Just when you ordered the books for the newest fad, something newer comes out.

Don't tell me how hard you work. Tell me how much you get done. -- James J. Ling

Working...