Wednesday, March 7, 2012

News / Article Application Storage

Hi,

I'm building a straightforward-ish news site. Currently, the story details (e.g. headline, description, author, date) are stored in a SQL DB. The news is categorised and the category details are also stored in an SQL table.

However - what is the best way to store the actual news article?

At the moment, when the user enters a story, they input the details and article text. The details are saved in the DB and the text is saved as an XML file with filename corresponding to the article DB primary key. When the story is "read" the app pulls the details from the DB and loads up the appropriate XML file from disk.

For various reasons, I need to keep the article stored as XML, either in a file or in the DB. The DB provides for faster sorting and retrieval, and I don't want to store large amounts of data (i.e. the article itself) in the DB if avoidable.

I guess there are a few ways to do it -

1. Store details in DB and article as XML file.
2. Store details and article in same DB table
3. Store details in one DB table and articles in another

I would imagine that 3 would be the best, but would there be a performance hit? What is the maximum size of field (i.e. article size) I can have in a table?

Cheers

Graham Wilson.

I'm using choice 2 in my application.

In DB design, there is no need to use different tables for fields that can be in one table.

HTH
Regards

|||

OK, thanks.

My reasoning behind using two tables was because I was unsure if having a lot of data in one table would slow down any retrieval or searching?

|||

pipelineconsulting:

OK, thanks.

My reasoning behind using two tables was because I was unsure if having a lot of data in one table would slow down any retrieval or searching?

I don't think that will do any performance changes.

No comments:

Post a Comment