faster? Db or XML

  • Thread starter Thread starter David Bartosik - MS MVP
  • Start date Start date
D

David Bartosik - MS MVP

I have data in two stores, an Access database and an XML file that
duplicates the same data. ( the latter in case the former gets corrupted ;-)

In designing an asp.net page that needs to get said data I'm wondering which
would have the better performance, a while loop thru a data on the db or
reading thru the xml file.

Anyone got experience and insight?

--
David Bartosik - MS MVP
for Publisher help:
www.davidbartosik.com
enter to win Pub 2003:
www.davidbartosik.com/giveaway.aspx
 
The database would likely take longer to instantiate a connection, where as
an XML file is quicker to open.
After that the database would likely be a bit faster.
If you need multiple threads (or users) accessing that data at the same time
then the database would be the clear winner.
XML's strength is not its speed but its interoperability.
 
I would usually go for the database. It stored data much more efficient and
indexes can be used to only access a very small piece of the data. Also
doesn't it need to interpreted the content of the data.

XML demands that the entire file is always accessed and interpreted.
Probably XML will also put larger constraints on your memory usage.

It is up to your application. If its small, just select the XML file, when
it gets bigger, access might work faster.

- Joris
 
Of course, the question was whether the Access database would be faster than
an XML file. SQL Server would definitely be better. Access... I believe it
would all depend on the amount of data stored in it. A large Access database
might take just as long as an XML file.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
400 records in this case, 2 fields only, the ID key and one string field.
 
I think I'd go with Access in that case (assuming I couldn't go with a real
database server, and the traffic to the site is not too heavy - Access is
not designed for Internet use).

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
I know. Use SQL at work. But this is on my own site and the host supports
Access for free (sql is extra charges) and mvp'ing doesn't pay that well ;-)

David
 
Understood, David! I am using an Access database as the back end of
discussion groups on my site. But I get under 1000 visitors a day!

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Back
Top