Access vs. XML

Ray Turner
Ray Turner used Ask the Experts™
on
I have an ASP .NET website that queries an xml file using LINQ to construct some pages. I'm considering using Access to do this since some of the queries are becoming quite complex.

a. Will Access give me the performance boost I'm seeking?
b. Will it make code easier to maintain?
c. Are there any caveats to watch out for?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
John TsioumprisSoftware & Systems Engineer

Commented:
It reckon it will be faster if you "transfer" the XMLs to standard Ms Access Tables/Queries....if i understood you correctly...
Can you give a small sample?
ste5anSenior Developer
Commented:
In short:

a) no.
b) no.
c) yes.

btw, what does "construct pages" mean?

Generally speaking:
Using a database for storing variant data by the means of page content makes sense. Many content management systems (CMS) are doing this. This is often simpler to implement and gives a reliable, scalable performance without to many couplings. Easy to implement does not mean easy to maintain, complexity of maintenance depends on the architecture you chose.
On the other hand, some of the fastest CMS are using simple files and intelligent caching and a lighting fast HTTP server..  

And the caveat: Use an appropriate SQL Server edition instead of Access. Access can handle this, but it can be hard to implement, cause Access is a front-end desktop database with a strong focus on single user interaction. Getting done the things right for an ASP.NET application can be pretty hard.
Most Valuable Expert 2015
Distinguished Expert 2018
Commented:
a. Yes. Any database - filer or server based - will be faster than XML
b. No. Your LINQ code should require very little if any tweaking
c. Not really. But you must have create-read-write access to the folder holding the accdb file

/gustav
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Ray TurnerSenior Consultant

Author

Commented:
Thanks to you all.  That makes a lot of sense.  XML is a flat file.  Indices are not being used when a queried.  

All queries start at the top of the file and read every record all the way to the end of the file. :(
Also, doing join queries are a nightmare in XML.

I think I will definitely explore Access.  It has to be a better solution than XML.

BTW - Construct is just another word for 'build '
ste5anSenior Developer

Commented:
Then the performance of querying does not really matter, cause writing files to disk is much slower.
Ray TurnerSenior Consultant

Author

Commented:
Ste5an,

Thanks for the comment.  I have one last comment.
True, writing to disk can be slow.  To be more specific; writing to a database is much slower than writing to XML because database updates require update to indexes, etc. which can make lengthen the updating process depending of the number of rows and columns to be updated.  XML; on the other hand is pretty straightforward, just append the data to the file.  However, in my situation it does not matter.

a. The data, for the general user, will be read only .  Admin will be the only user updating the data.
Most Valuable Expert 2015
Distinguished Expert 2018

Commented:
writing to disk can be slow.

In general, that is not the case. Writing a plain file is pretty fast.

All queries start at the top of the file and read every record all the way to the end of the file. :(
Also, doing join queries are a nightmare in XML.

That is exactly the point. And that is what the database engine solves by indexing the data and caching the data for multiple reads.

/gustav
Most Valuable Expert 2015
Distinguished Expert 2018

Commented:
That seems to cover it.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial