Re: XML files as Database storage ?

From: Date: Wed, 04 Apr 2001 11:38:53 +0000
Subject: Re: XML files as Database storage ?
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-165@lists.php.net to get a copy of this message
Joao Prado Maia schrieb: > I just nearly completed a poll like package using PEAR as the Database > abstraction utility for it and got a suggestion to also support text files > as the 'database' for this package. > > Would it be possible to develop something to store this database in XML > files ? It would be extremelly cool if I could use the same exact function > that I already used on my package to treat 'xml' as just another option of > database, just like 'mysql' and whatnot. > > Yes, I know it's really a bad idea to store something in pure text files > instead of just using a normal database engine, but brazillian users often > use this method for _really_ simple sites that can't have a db server > running. > > Anyway, would it be possible to do something like this ? Yes, it is, but it's not that simple as it looks like. Most databases use relational structures whereas XML has a hierachical structure. It's very hard to find a good mapping from one structure to the other. It may be possible for object oriented databases and XML but it's hard for XML/RDBMS. That's why you'll have lots of problems mapping SQL to XPath (or XQL which is some kind of XPath). Do do a good job you'd probably have to work on a higher level of abstraction over the query language, means you'll have to deal with entities and relations but not with SQL or XPath. As soon as you solved this problem you'll find new ones. Storing XML files in the filesystem is a simple and straight forward way but what about versioning, permissions and concurrent accesses? If you have a (nearly? generic) solution for this you're very much welcome, but I doubt that one can hack such a solution within a weekend or two. Have a look on e.g. Tamino from http://www.softwareag.com/ to see the power and dimensions of your ideas, but ... Ulf -- Ulf Wendel, NetUSE AG Siemenswall, D-24107 Kiel Tel: +49 431 386 436 00, Fax: +49 431 386 435 99

« previous php.pear.dev (#165) next »