• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XML as database

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 !
 
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
     
    Marshal
    Posts: 28177
    95
    Eclipse IDE Firefox Browser MySQL Database
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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).
     
    Ranch Hand
    Posts: 2187
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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 ]
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    reply
      Bookmark Topic Watch Topic
    • New Topic