[Lazarus] Web development and XML database (Mattias)

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Nov 17 16:54:15 CET 2011


Juha Manninen <juha.manninen62 at gmail.com> hat am 17. November 2011 um 15:58

> 2011/11/17 Mattias Gaertner<nc-gaertnma at netcologne.de
> [mailto:nc-gaertnma at netcologne.de] >
> >  
> >  
> > XML was invented to markup texts. Later programmers noticed that it is also
> > nice for config files.
> > A few hundred MB of XML does not sound much compared to some big SQL
> > databases. But because it is "not that much" we want to search them in real
> > time (multiple queries taking less than half a second). That is not a
> > trivial task, not in a XML database, nor in a SQL database.
> >  
> > Another important point is, that our data is hierarchical, has lots of
> > optional elements and attributes, the data model changes often and the data
> > is inconsistent. Using a SQL database for that would be stupid.  
> > After a year of programming with hierarchical structures I came to the
> > conclusion, that hierarchical databases are greatly underestimated. If your
> > SQL tables are not filled dense and/or if you have a lot of parent-child
> > relationships you should try them out.
> > 

> In 1990's there was hype about object DBs which would replace relational DBs.
> For some reason they disappeared.
> Now the existing object DBs are built on top of a relational DB, like the
> eMatrix I mentioned.
AFAIK eXist DB also uses a relational backend. Uploading XML files is hundred
times slower than our XML database.
Writing and maintaining a database is a lot of work.
That's why we skipped the complicated part of special disk structures. The
database is only for data that fits into memory. And at the moment there are no
plans for special query optimizations, as the brute force searches are already
fast enough.
Indexes are planned. They are probably needed when the data grows to several
hundred MB. 

> I understood that XML is only the input data format for your DB. It is parsed
> into a memory structure and searches are done there. Then it could be called
> in-memory DB as well because the XML format is not the essential part.
Yes, it is an in-memory DB. But the xml is essential. Input and output are xml.
There are no none xml files. 
Of course in memory the layout uses trees and pointers to represent the XML, so
the server requires several times more memory than the size of the xml files.
About two to four times on a 32bit system. 
Relational DBs don't necessarily store the tables as 2D arrays in memory/disk.

> Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20111117/547c9873/attachment-0003.html>

More information about the Lazarus mailing list