Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML as database

 
Swathi Kota
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
We are developing an application for which I am asked to use XML as database instead of the standard relational DBs like SQL.

Can anyone guide me as to where to start?how can i insert and update data into XML?Suggest me good books,links or anything useful.
Thanks in advance !
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Swathi,

If you have static XML document that is not going to change, its ok to use
that.Using XML as database is not a good/preferred option because of
following obvious reasons:

1- Inefficient for dynamic documents.
2- More disk space is required to store XML documents, because of
redundancy.
3- It is not practical for insert/update/delete operation as you need to
load entire XML document into memory (eg. using DOM) and modify its nodes as
required. After that you need marshal that document again into disk.
It is resource intensive and time consuming task.
4- You won't get benefits of relational database.

Generally XML is generated lookup into database or any data source
on the fly as per required depending upon user request for example.
[ November 05, 2008: Message edited by: Chandra Bhatt ]
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Number 4 would be top of my list. Using an XML file(s) instead of a relational (or otherwise) database means your data store is:
  • non transactional
  • not available in distributed environments
  • will struggle to support concurrent access
  • does not guarentee ACID behaviour

  • etc.
     
    Paul Clapham
    Sheriff
    Pie
    Posts: 20196
    26
    MySQL Database
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Here's a link to the Wikipedia article about XML databases. If you read it, you will see that the strategy of storing all your data in a single monster XML document isn't described there. I think that's because (as already mentioned by earlier posters) it really isn't a very good idea at all.

    But your task is just to "use XML as database". That doesn't necessarily mean one monster XML document anyway. It could mean something sensible. It could mean a lot of things. Perhaps you should clarify the requirements before you start designing (or buying).
     
    Jimmy Clark
    Ranch Hand
    Posts: 2187
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    An XML-based file format as a database can be an effective solution. It really depends upon the requirements and how the data will be processed, i.e. created, updated, edited, deleted.

    SGML-based databases have been around a very long time. Typically in the GB range. There are more efficient technoglogies than Java however. Do a search for OmniMark programming language.

    Check out the Apache Digester component

    http://commons.apache.org/digester/

    Checkout Apache XMLBeans

    http://xmlbeans.apache.org/

    Checkout the XML Cover Pages

    http://xml.coverpages.org/
    [ November 06, 2008: Message edited by: James Clark ]
     
    I agree. Here's the link: http://aspose.com/file-tools
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic