471,316 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,316 software developers and data experts.

sqlite or xml

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!
Dec 6 '07 #1
7 3876
On Dec 6, 10:21 pm, Kelie <kf9...@gmail.comwrote:
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!
I'm personally partial to databases myself and at a thousand records a
database is good idea, or an indexed file. Depends on what you want
to do with it in the end which should resolve the problem. Do you
need it to accessed (read & write) by multiple people ? Or would it
just be a single transaction process (ie. just you locally)
Dec 6 '07 #2
how much data is considered to be "large amount"?

one record

Unless you really need XML to communicate with some other app via
a predetermined schema, use a database to store and retrieve
data. If you only need to send data to another app via a
predetermined schema, use a database and then offer an "export to
XML" functionality.

for s in ['regular expressions', 'XML', 'perl', 'WS-*']:
print """
Some people, when confronted by a problem,
think "I know, I'll use %s!"
Now they have two problems.""" % s

-tkc
Dec 6 '07 #3
Tim Chase wrote:
>how much data is considered to be "large amount"?

one record

Unless you really need XML to communicate with some other app via a
predetermined schema, use a database to store and retrieve data. If you
only need to send data to another app via a predetermined schema, use a
database and then offer an "export to XML" functionality.
I agree. IMO, XML should be used as a data exchange format, not as
database format for databases of *any* length. Though some
products/projects may tell you otherwise.

I won't limit data exchange to only other apps/programs. One benefit of
XML is that it's relatively human readable, so exchanging data directly
with humans using XML is probably acceptable, but shouldn't be encouraged.
Dec 6 '07 #4
Tim Chase wrote:
>how much data is considered to be "large amount"?

one record

Unless you really need XML to communicate with some other app via a
predetermined schema, use a database to store and retrieve data. If you
only need to send data to another app via a predetermined schema, use a
database and then offer an "export to XML" functionality.
I agree. IMO, XML should be used as a data exchange format, not as
database format for databases of *any* length. Though some
products/projects may tell you otherwise.

I won't limit data exchange to only other apps/programs. One benefit of
XML is that it's relatively human readable, so exchanging data directly
with humans using XML is probably acceptable, but shouldn't be encouraged.
Dec 6 '07 #5
Thanks Chris, Tim and Yu-Xi. I'll follow your advice and use database.
Dec 6 '07 #6
On Dec 7, 12:34 am, Kelie <kf9...@gmail.comwrote:
Thanks Chris, Tim and Yu-Xi. I'll follow your advice and use database.
Hi Kelie

If you're happy going with sqlite then stick with it. If on the other
hand you were considering XML because you're more comfortable with
that (e.g. you find XML easy to work with and you're more familiar
with XPath/XQuery than SQL) then you could use XML if you wanted. The
choice is not between XML and databases, it's between XML and
relational. There are -- shock-horror! -- full-featured XML databases
too (e.g. Berkeley DB XML, which is lightweight, fast, embeddable and
open source like sqlite, with indexing, transactions etc. if you need
that). XML is very widely used in publishing and not only as a data
transfer format which happens to be human-readable. The main reason
for going for a database over a file in your case is I'd guess to
support searching, since performance wouldn't be an issue these days
with a few thousand records.

Developers tend to have strong feelings in favour of relational (=
"tabular" storage) over xml database (= "hierarchical" storage) but
this will change. If you are asking what would work for your
relatively simple use-case, the answer is both, since the storage
model isn't that important for a contacts address list. What would
work best for you in this case is whichever you would prefer...

TimvN

Dec 7 '07 #7
On Dec 6, 3:37 pm, tinkerbar...@gmail.com wrote:
If you're happy going with sqlite then stick with it. If on the other
hand you were considering XML because you're more comfortable with
that (e.g. you find XML easy to work with and you're more familiar
with XPath/XQuery than SQL) then you could use XML if you wanted. The
choice is not between XML and databases, it's between XML and
relational. There are -- shock-horror! -- full-featured XML databases
too (e.g. Berkeley DB XML, which is lightweight, fast, embeddable and
open source like sqlite, with indexing, transactions etc. if you need
that).
Tim?

Ah, now you're making it hard for me to decide again. :-) Talking
about comfortable, I do like Amara XML toolkit a lot. But I'll stick
with sqlite in this case.

Thanks for your valuable input and for mentioning Berkeley DB XML. I
didn't know about it and will have to read about it.
Dec 7 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by David Fowler | last post: by
12 posts views Thread by John Salerno | last post: by
4 posts views Thread by Jim Carlock | last post: by
14 posts views Thread by 7stud | last post: by
10 posts views Thread by Luigi | last post: by
9 posts views Thread by Gilles Ganault | last post: by
8 posts views Thread by Gilles Ganault | last post: by
reply views Thread by Joe Goldthwaite | last post: by
20 posts views Thread by timotoole | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.