SunQuest
 
           Database Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesDatabase Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old May 30th, 2002, 10:15 AM
blaz blaz is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2002
Posts: 2 blaz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
  #2  
Old May 30th, 2002, 05:37 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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

Reply With Quote
  #3  
Old May 30th, 2002, 09:46 PM
mytch mytch is offline
Dev Articles Novice (500 - 999 posts)
 
Join Date: Apr 2002
Location: Sydney, Australia
Posts: 589 mytch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
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?

Reply With Quote
  #4  
Old May 31st, 2002, 09:54 AM
blaz blaz is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2002
Posts: 2 blaz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #5  
Old February 9th, 2007, 01:52 PM
rosen rosen is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 1 rosen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m 49 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesDatabase Development > Database vs. XML


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway