Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > reading the DB vs. reading a text file...performance preference?

Reply
Thread Tools

reading the DB vs. reading a text file...performance preference?

 
 
Darrel
Guest
Posts: n/a
 
      11-11-2004
I've been working on a fairly simple CMS for a fairly small site. Each page
is a DB query to grab the content for the page.

I also have some ancillary content that isn't specifically associated with
one specific page. For instance, the page footer, which is the same on every
page.

The authors can edit this content which is then stored in the DB. In terms
of retrieving it, I could query the DB on each request, or whenever the
content is changed via the admin tools, I could have it spit it out as a
text file, and then include the file with a plain-old include statement on
each page.

Performance-wise, is there a difference between the two? Is the effor to
write out the new text file from the DB worth any performance gain?

I realize this is probably hypothetic on the size of site I'm working on,
but i'd like to go ahead and use the best method if there is one.

-Darrel


 
Reply With Quote
 
 
 
 
Scott Allen
Guest
Posts: n/a
 
      11-11-2004
If the content ultimately resides in the DB, I'd avoid spitting out
the text files - that might be messy to clean up and the performance
gain would not be worth the effort.

A simpler solution would be to use memory caching (I'm assuming the
content is relatively small). You could keep the content itself in the
cache as a string to write into the page, or you could place the
content into a user control and use partial page caching.

Some more caching info:
http://msdn.microsoft.com/library/de...sbestpract.asp

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 10 Nov 2004 22:22:25 -0600, "Darrel" <>
wrote:

>I've been working on a fairly simple CMS for a fairly small site. Each page
>is a DB query to grab the content for the page.
>
>I also have some ancillary content that isn't specifically associated with
>one specific page. For instance, the page footer, which is the same on every
>page.
>
>The authors can edit this content which is then stored in the DB. In terms
>of retrieving it, I could query the DB on each request, or whenever the
>content is changed via the admin tools, I could have it spit it out as a
>text file, and then include the file with a plain-old include statement on
>each page.
>
>Performance-wise, is there a difference between the two? Is the effor to
>write out the new text file from the DB worth any performance gain?
>
>I realize this is probably hypothetic on the size of site I'm working on,
>but i'd like to go ahead and use the best method if there is one.
>
>-Darrel
>


 
Reply With Quote
 
 
 
 
Darrel
Guest
Posts: n/a
 
      11-11-2004
> If the content ultimately resides in the DB, I'd avoid spitting out
> the text files - that might be messy to clean up and the performance
> gain would not be worth the effort.


Thanks, Scott. I'll look into the cacheing option.

-Darrel


 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      11-11-2004
If the content is more or less static, you could read it either from a file
or DB, and store it in the Application Cache, to minimize IO cost.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.

"Darrel" <> wrote in message
news:##...
> I've been working on a fairly simple CMS for a fairly small site. Each

page
> is a DB query to grab the content for the page.
>
> I also have some ancillary content that isn't specifically associated with
> one specific page. For instance, the page footer, which is the same on

every
> page.
>
> The authors can edit this content which is then stored in the DB. In terms
> of retrieving it, I could query the DB on each request, or whenever the
> content is changed via the admin tools, I could have it spit it out as a
> text file, and then include the file with a plain-old include statement on
> each page.
>
> Performance-wise, is there a difference between the two? Is the effor to
> write out the new text file from the DB worth any performance gain?
>
> I realize this is probably hypothetic on the size of site I'm working on,
> but i'd like to go ahead and use the best method if there is one.
>
> -Darrel
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading a file and resuming reading. Karim Ali Python 2 05-25-2007 02:04 PM
UnauthorizedAccessException when reading XML files (no problem when reading other file-types) blabla120@gmx.net ASP .Net 0 09-15-2006 02:08 PM
DVD ROM not reading DVDs but reading CDs sayeed.afzal@gmail.com Computer Information 0 05-22-2006 10:37 AM
Controlling text in a Text Area or Text leo ASP General 1 12-05-2005 01:13 AM
ASP.NET Reading problem (reading .xls) Wael Soliman ASP .Net 2 01-03-2005 05:33 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57