sqlite or xml

oj ojeeves at gmail.com
Fri Dec 7 11:52:36 EST 2007


On Dec 6, 8:21 pm, Kelie <kf9... at gmail.com> wrote:
> Hello group,
>
> If I need store and use a couple thousand of people's contact info:
> first name, last name, phone, fax, email, address, etc. I'm thinking
> of using either sqlite or xml. Which one is better? My understanding
> is if there is large amount of data, sqlite would be better as far as
> speed is concerned. But how much data is considered to be "large
> amount"?
>
> Thank you!

Stick with a database.

The data you are representing doesn't really have a hierarchical
structure, so wouldn't really benefit from being represented in XML.

Also, I assume that you would want random access to the data. Most DOM
implementation would require parsing the entire XML document to build
a DOM tree, which is inefficient if you just want to update/retrieve
one record. Relational databases on the other hand are designed for
exactly this type of data access. A relational database will also
allow you to search your data easily without having to parse a whole
XML document. In particular, if the number of records you are dealing
with, or the amount of data stored against each record increases
significantly, then you'll find accessing your data becomes slower and
slower.



More information about the Python-list mailing list