|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Database vs. XML
I can't realy get to understand how could XML be useful to store data for a database-driven web site. Isn't data already described when properly put in the database. I read about how to use XML to store content, and than use XSLT to create XHTML (layout), and use CSS to apply design to XHTML layout. But what I didn't get is when I read "...and you store your XML data into a database". What is the purpose of storing XML marked content into a database?
And when I think about dinamyc data driven web site, it seems illogical to use XML at all. If I want to do queries on my data it is best (I think) for the data to be in a database. For example: If I wanted to count how many articles were published on my site. This seems harder (and slower) to do without a database. It seems logical to use XML for exchanging data between different systems. But how could this benefit me at bulding non-static sites? Well this are some of my thoughts. Please make some comments and enlighten me. How shoud I use these techologies? |
|
#2
|
|||
|
|||
|
personally i dont use xml and im not planing to, unless i dont have access to a database (im not planing on putting myself in that position). the main reason i find xml, we crap is because of the lack of security, of course your not going to have credit card details in a xml file, but say if someone found your xml file, the could use that to maybe exploit something??? i could be wrong about it, but i find a database much more convient and more secure,
i could be totally wrong but i dont care, their my reasons, im sure theirs a valid reason for using xml, i just dont see it, or want to see it |
|
#3
|
|||
|
|||
|
Hi Blaz,
Welcome to our forums I hope you feel at home.XML is a topic that many a debate has been had over. Personally, I love it. We use it here on DevArticles.com to cache frequently requested data for the front page so that it loads quickly. For example, when we add a new article, the latest 3 are cached something like this: <articles> <article> <id>1</id> <title>Article title here</title> <author>Mitchell Harper</author> <rating>8.33</rating> <URL>art/1/45</URL> </article> </articles> so that way we just read the cached XML and pop it onto the front page..its alot quicker than connecting to the database. We also use XML for our content feed at http://www.devarticles.com/devarticles_recent.xml. About 60 other sites use this to add value to their sites, and they take the XML with Perl/PHP and format it how they want it to look. It's a great way to share your data. With XSLT, I haven't really found much use for it although i may implement it into our content feed soon enough. I guess it just comes down to flexibility: I like XML and databases. But I would only use XML as an easy way to transport data to others. Hope this has helped you? |
|
#4
|
|||
|
|||
|
Well, for me the idea of XML is great to. In the field of comunication between organizations this is really a good thing. You can easely write all documents in one format and hava XSLT to transform this XML to a form suited for other organization.
From web site point of view I can see the advantage of XML&XSLT in presenting content for different devices from the same source of content (XML files). I personaly think that XML without XSLT has no meaning for building web-sites. XSLT is a solution of abstracting web-site layout. Whith different XSLs you can apply different layouts just like you can apply different styles with stylesheets. This can probably be useful for adjusting layout and quantity of content for different resolutions. I don't know but do various PHP template systems use XML and XSLT to achieve their goal. This seems to be a great solution to implement this kind of thing. Still a question remains. Why use database with XML? P.S.: Sorry for my english. It may not be understndable. |
|
#5
|
|||
|
|||
|
XML as a RDBMS
I have set up a relational database-like architecture using nothing but XML as a back-end.
One XML file referred to permissions, such that each permission applied to a specific action. (ie: user/add/user or user/edit/document) Another XML file referred to roles so that each role held subnodes for each permission it contained. Finally, another XML file referred to all users which had a mixture of roles and specially-assigned permissions for specific resources. The whole solution was less than 2kb, and the code was only about 100 lines long that specified whether a user had access to a specific resource. However, XML's real power is in hierarchical data. For instance, in the same solution, I had created another XML file for projects. Since projects can have sub-projects, I simply added a child node for each sub-project (each project adhered to a project template, and thus had to have certain attributes and child nodes). Although this can be set up in a typical relational database, you'll find it's a little more complicated and takes a lot more code. Moral of the story.. if you've got hierarchical data, use XML. If you've got a relatively small amount of data that can be stored in memory, use XML. If you're going to return thousands of rows of data, use a database. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Database Development > Database vs. XML |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|