user763554
user763554

Reputation: 2041

SQL Server database or XML, what to choose for asp.net app?

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.

Upvotes: 1

Views: 858

Answers (3)

RickNZ
RickNZ

Reputation: 18654

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.

Upvotes: 1

Sap
Sap

Reputation: 5301

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.

Upvotes: 1

TomTom
TomTom

Reputation: 62101

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.

Upvotes: 3

Related Questions