SQL vs XML

  • Hi all.

    Can any one tell me witch way is faster??

    Storing data in an SQL server Database and use them in my aspx pages or storing data in an XML file and running queries in the xml file??

    Note. The data is not for data binding direct to the form. I want some values to set in some controls.

  • Hi there

    Its is raw speed your after, xml in files and stylesheeting the results is very quick. The DB option, even with xml coming from the db and stylesheeting that will be slower, but not by amazing amounts. Of course, the flexibility here is changing data in the db is simpler than maintaining xml files.

    Cheers

    Ck

    Chris Kempster

    http://www.chriskempster.com

    Author of "SQL Server 2k for the Oracle DBA"


    Chris Kempster
    www.chriskempster.com
    Author of "SQL Server Backup, Recovery & Troubleshooting"
    Author of "SQL Server 2k for the Oracle DBA"

  • I would add that you should give some consideration to the permanence volume and security of the data you're going to be manipulating. Basicaly the XML route is fine for transitory low volume stuff, but if there's any chance that the volumes can grow significantly, or you want to hold the data for any length of time then the overhead of DB access is well worth it.

    I have found it is possible to please all of the people all of the time if you do exactly what they want. Harold Macmillan 1961


    I have found it is possible to please all of the people all of the time if you do exactly what they want. Harold Macmillan 1961

  • Well let's see. If all you are doing is selecting data in your XML files and the files are fairly small then XML might be faster. As soon as you start to manipulate the data and do some serious joining of data from one table to the next then the DB is going to outperform the XML.

    Me, I'll take the robustness of the database any day. It's much easier to update lots of data in a simple manner. Plus with proper backup stategies you can literally restore the db right up to the 'x' named transaction if needed. Not something that can easily be done with XML files unless you have them stored in a source controlled environment. Also as stated above the security with XML files could be much more complicated than with the DB. And last but not least what happens when you out grow your server and have to replicate the files? How are you going to solve the merging of the changed files?

    Gary Johnson

    Microsoft Natural Language Group

    DBA, Sr. DB Engineer




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply