473,505 Members | 13,807 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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
Nov 18 '05 #1
3 1978
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" <no*****@nospam.com>
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


Nov 18 '05 #2
> 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
Nov 18 '05 #3
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" <no*****@nospam.com> wrote in message
news:##**************@tk2msftngp13.phx.gbl...
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

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
3089
by: Jeff Pritchard | last post by:
I have an MDB that contains a single table. Checkweigher data is being continuously written to this MDB from a dedicated workstation over a network into the MDB on the server at the rate of about...
6
6320
by: Rajorshi Biswas | last post by:
Hi folks, Suppose I have a large (1 GB) text file which I want to read in reverse. The number of characters I want to read at a time is insignificant. I'm confused as to how best to do it. Upon...
0
1368
by: Einar Høst | last post by:
Hi, I'm reading data from a text file, and having read a bit on performance and memory, I'm wondering how it could be done in the fastest, most frugal way. The data comes in messages, one per...
6
3528
by: Einar Høst | last post by:
Hi I'm trying to learn a bit about performance, hope someone can help me out I have a text file with 8-bit characters in it. In order to improve performance, I'm using a BinaryReader instead of...
13
3936
by: mloichate | last post by:
I must read a very heavy-weight text plain file (usually .txt extension) )and replace a given character with another given character in all text inside the file. My application was working pretty...
7
6032
by: John Dann | last post by:
I'm trying to read some binary data from a file created by another program. I know the binary file format but can't change or control the format. The binary data is organised such that it should...
3
1788
by: lizii | last post by:
i have a file - which on each line has some data i need to fill into a box - now although reading in the data is simple enough and putting it in the correct box will be no problem, as i can just...
6
5243
by: arne.muller | last post by:
Hello, I've come across some problems reading strucutres from binary files. Basically I've some strutures typedef struct { int i; double x; int n; double *mz;
13
3660
by: swetha | last post by:
HI Every1, I have a problem in reading a binary file. Actually i want a C program which reads in the data from a file which is in binary format and i want to update values in it. The file...
0
7213
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7298
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
406
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.