Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Depends on the time of year
    Posts
    478
    Thanks
    0
    Thanked 0 Times in 0 Posts

    databases vs. xml... what gives?

    I've read extensive articles on xml, and I still don't understand how it might be the future of webuilding.

    I figure, xml saves all the information as various datatypes, and you can see it in the format you see fit. How is that any different from using some language to call in from a database? Or have i seen it from the wrong light?

    Any thoughts? If you think xml is better, could you please state why, I'm wondering if its worth learning or not for later projects. How would you use XML over a database itself?

    Duniyadnd

  • #2
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    The advantage of XML does not lay in databases. Any database is faster than a flatfile, including XML. The power of XML lays in the fact that the file describes the information itself.

    <address>
    <name>John Doe</name>
    <box>123</box>
    <street>Elvis Ave.</street>
    <city>New York</city>
    <state>New York</state>
    </address>

    Is a lot more informative than a table-based structure, such as MySQL.

    Also, since XML is very open, there are a lot of other things possible with it. SVG, MathML, XSLT, XUL, all sorts of very powerful XML applications are already at your disposal.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    North East England
    Posts
    853
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It's been used in Flash for years as a means of storing data - both content and layout/structural - outside the main *.swf.
    [+] Computer/PC issues [+] Silverpaw3D
    ------------------------------------------------
    Never buy a dwarf with learning disabilities...

    ...it's not big, and it's not clever.

  • #4
    Regular Coder
    Join Date
    Oct 2002
    Posts
    380
    Thanks
    0
    Thanked 0 Times in 0 Posts
    xml is primarily about data interchange, not data storage. The key power it provides is to completely seperate data, data definition, and functionality (including presentation) while making these all easy to share.

    If I send you an xml file (data), I should include a dtd. The dtd tells you what each element in the file means. This is something that databases simple do not do.

  • #5
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,073
    Thanks
    11
    Thanked 98 Times in 96 Posts
    but....

    a database can hold the data , metadata and attributes (even validation) etc that an XML file contains, any DB + SQL is a super method for cranking out XML files in the format required, rather than say XML to MXL transformations + also of course it can pump out the data directly into an non-xml application or data stream.

    I am trying harder than ever these days to use XML and actually succeeding occaisionally, but in every instance I have found it far easier to store not XML files but a DB representation of such and call that when required.

    I think you would be mad to not learn XML (the basic-basics are pretty straightforward) as it is already used in a wide range of applications etc (simple RSS newsfeeds for example are a good example), understanding XML will probably be as important as understanding HTML in the very near future.

    But XML vs DB ? I dont think thats a straight fight, I think that a combo of both can be a powerful tool

    just my tuppence-worth
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •