[Tutor] Database acces vs XML

Guillermo Fernandez guillermo.fernandez at epfl.ch
Mon Sep 29 19:58:52 EDT 2003


Hi,

Thanks for the answers. Everything seems to indicate that XML does not
answer my problems, as I was thinking in using DOM-based model.

 > Perhaps the best approach would be to write some kind of parser (not
 > necessarily XML-based) to read through your log files in the same
 > fashion as a SAX parser, performing callbacks as it goes, without
 > actually reading everything into memory.  If each entry is on a
 > separate line, you can use the xreadlines method of the file object to
 > do this.
I already programed a parser that reads the file line by line with 
xreadlines, but the dataprocess I need implies some kind of data 
storage, either in a database or in memory as I do it now (and one of 
the problems of my disgrace ;-)

 > The RDBMS solution (you can use sqlite for that, there's a pysqlite
 > binding --- it's a file based database, very fast and requires no
 > maintenance work) seems better to me (but we already use databases for
 > other projects here)... It is also faster and can simplify a lot of
 > the work if it's done on the server instead of on the client
As I'm working only with the log files, I've no server-client problems 
to take into accoount :-)

I had a
look to the pysqlite module, and seems to better fit my needs.In the 
docs they say sqlite "fully comply with the Python Database API
v.2.0 specification" and give no further details about pysqlite use. I
had a look into the python library reference and there seems to be no
"standard" database module. All those different database modules are
quite confusing! Is there any tutorial for using databases with the
Database API specification? Or describing this specification?

Thanks,

Guille







More information about the Tutor mailing list