SQLite vs SimpleXML; For small redundant data
View Single Post
03-13-2008, 03:29 PM
Join Date: Mar 2008
Re: SQLite vs XML
A few questions you need to ask:
1) Does each page access exactly the same data from the XML file?
2) Is the number of pages going to stay constant over time, or is it increasing?
3) Is the XML file "small" or "large"?
4) Will the content of the file stay the same during web site operation?
5) Will you write to the file during web site operation?
6) Will you need more such XML files over time?
7) Did you choose XML because you need to share data with another application?
If your answer to most of these questions is "yes", then stay with the XML file. It already works, and that is its biggest value now.
If your answer to most of these questions is "no", then you will end up spending time and money tuning the access, storage, update, performance, and consistency of the data in that file(s). You would be much better off using SQLite in this case.
If you are repeatedly reading from the file, XML or SQLite, your program will spend a lot of time parsing either XML or SQLite queries. If your file grows, the SQL gets cheaper to parse. If your program spends time traversing the file looking for stuff, SQLite probably wins with a big file because it implements a B-Tree under the covers, while you need to do a linear search with the XML every time. This performance stuff is moot if your file is "small".
See my site at
SQLite The Hammer on Squidoo
for more thoughts on SQLite.
The Following User Says Thank You to JayGodse For This Useful Post:
View Public Profile
Send a private message to JayGodse
Find More Posts by JayGodse