1

I have a database with about 10,000 records. Each record has one text field (200 chars or so) and about 30 numeric fields.

The asp.net app only does some searching and sorting and displaying data in a grid. No data sharing between users, read only operations (no database updating), very little calculation.

Should I go with an XML file and use Linq or should I use an SQL Server database? Please give me explanations of your choice.

1
  • 1
    31 fields for 10,000 records = 310,000 elements (not including any for hierarchy). You might (especially if the file grows) run into a memory issue using XML. Commented Feb 6, 2012 at 5:07

3 Answers 3

3

Should I go with an XML file and use Linq or should I use an SQL Server database?

TOTAL non issue - SQL.

The asp.net app only does some searching and sorting

Read up on a beginner SQL book what an "INDEX" is. XML files have none - so SQL databases are a lot more efficient with sorting and filtering.

Sign up to request clarification or add additional context in comments.

1 Comment

+1 database hands down, if you want to avoid the costs of a full sql server version then the SQL Server 2008 R2 Express should be more than sufficient for now and much faster and scalable than XML. Plus if you later need to scale up past the limits of XML you don't have to re-write your entire application if you used SQL all along
1

It really depends on your needs, Ask your self following questions.

  1. Is your data set going to increase?
  2. Is speed one of the most desired thing of your app?
  3. Are you going to run complex queries?
  4. Is the schema of your data going to change?

If answer to most of the questions above is 'no' then feel free to use XML. Sql provides lot's of features and mainly intended for data storage and retrieval, while with XML you can store data but I would say its main usage is data interoperability and exchange

If your data set increases then SQL should be a choice because you can create indexes on your dataset which will increase speed of retrieval for the data, files are usually read serially and thus are slower for ad-hoc data search.

Comments

1

I think you'll find SQL to be much easier to develop and maintain. XML is great in some scenarios, but I've found it often presents a steady stream of headaches in the long term.

From a performance perspective alone, it's hard to say which approach would be better without knowing the details of your queries and schema. In general, though, SQL tends to win, since it's built for searching and sorting, where XML is not.

For a readonly dataset of that size, you might be able to read the whole thing into memory on the web server side, and do your searching and sorting there.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.