473,385 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Database Hit compared to ASP include?

@sh
Guys,

We're in the midst of building a new site and have some decisions to make RE
the meta data, i.e. Title, Keywords and Description.

We need to allow other non development staff to update such fields, there
will be an administration panel available to do this.

Seen as the site is very popular and receives many hits we're looking very
carefully at CPU load and memory use, therefore need some advice regarding
the two ideas below...

- We create a TXT file for each ASP page within the site containing the
title, desccription and meta tags, we then serverside include this file into
the top of its relevant ASP page.

OR

- We store Title, Description and Keywords in our SQL Server (v7) table and
query the DB at the top of each ASP page to extract the data for these meta
fields.

Which would have the least impact on our server in terms of CPU etc, or
perhaps there's a better way?

Cheers, @sh
May 22 '06 #1
14 1414
@sh wrote:
Guys,

We're in the midst of building a new site and have some decisions to
make RE the meta data, i.e. Title, Keywords and Description.

We need to allow other non development staff to update such fields,
there will be an administration panel available to do this.

Seen as the site is very popular and receives many hits we're looking
very carefully at CPU load and memory use, therefore need some advice
regarding the two ideas below...

- We create a TXT file for each ASP page within the site containing
the title, desccription and meta tags, we then serverside include
this file into the top of its relevant ASP page.
Only do this for static data, i.e., data that never changes. Text files do
not lend themselves very well to concurrent updates.

OR

- We store Title, Description and Keywords in our SQL Server (v7)
table and query the DB at the top of each ASP page to extract the
data for these meta fields.

Which would have the least impact on our server in terms of CPU etc,
or perhaps there's a better way?

Depending on how often the data changes, I would use either Application or
Session variables. I would use an SSI page that contains a class or function
that retrieves these items from the Application or Session cache if they
exist, or from the database if they are not available in cache (placing them
into cache after retrieving them from the database). You can even store an
expiration date in the cache to force your class/function to get new data
from the database and refresh the cache if the date has expired.

Just remember, when putting items into Application, use application.lock and
application.unlock to prevent concurrency problems.

Caveat: do not think about storing COM objects (such as ADO object -
recordsets, connections) in Application or Session:
http://www.aspfaq.com/show.asp?id=2053

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
May 22 '06 #2

@sh wrote:
Guys,

We're in the midst of building a new site and have some decisions to make RE
the meta data, i.e. Title, Keywords and Description.

We need to allow other non development staff to update such fields, there
will be an administration panel available to do this.

Seen as the site is very popular and receives many hits we're looking very
carefully at CPU load and memory use, therefore need some advice regarding
the two ideas below...

- We create a TXT file for each ASP page within the site containing the
title, desccription and meta tags, we then serverside include this file into
the top of its relevant ASP page.

OR

- We store Title, Description and Keywords in our SQL Server (v7) table and
query the DB at the top of each ASP page to extract the data for these meta
fields.

Which would have the least impact on our server in terms of CPU etc, or
perhaps there's a better way?

I would store it in the SQL server, it's what I just did in an
application I'm developing. There are several things you can do:
- Always get information from the DB. This is the easiest and safest
approach, but the one with the heaviest loads. For each page request,
you'll be asking the DB server, it'll get the data, pass it back to the
page, then the page will show. Depending on how many different pages
there are, and the overall load on the DB, these requests might need to
access the hard drive.
- Get information from DB once then save it in session variables.
This approach relieves the DB from subsequent page accesses, so the
load in the DB server is lessened, and the network traffic between the
IIS and the DB server is lower too. The two problems with this
approach are a) information might not be 'up to date' and b) IIS
server may use a lot of memory keeping track of all the session
variables for all the sessions
- Get information from DB then save it in application variables. Same
as above but IIS server doesn't have the potentially big load on memory
as the Session approach, but then you must deal with contention of
these variables (lock, unlock), with many concurrent sessions this
might be a problem.
- Create a scheduled task that periodically collects information from
the DB and creates include files or XML files that you use in your
HTMLs

Just a bunch of ideas

May 22 '06 #3

@sh wrote:
Guys,

We're in the midst of building a new site and have some decisions to make RE
the meta data, i.e. Title, Keywords and Description.

We need to allow other non development staff to update such fields, there
will be an administration panel available to do this.

Seen as the site is very popular and receives many hits we're looking very
carefully at CPU load and memory use, therefore need some advice regarding
the two ideas below...

- We create a TXT file for each ASP page within the site containing the
title, desccription and meta tags, we then serverside include this file into
the top of its relevant ASP page.

OR

- We store Title, Description and Keywords in our SQL Server (v7) table and
query the DB at the top of each ASP page to extract the data for these meta
fields.

Which would have the least impact on our server in terms of CPU etc, or
perhaps there's a better way?

Cheers, @sh

Combine both approaches:

Store the data in the db, and on the "add metadata" and "edit metadata"
admin pages, use Scripting.FileSystemObject to generate include files
using the new or updated information.

--
Mike Brind

May 23 '06 #4

Mike Brind wrote:
@sh wrote:
Guys,

We're in the midst of building a new site and have some decisions to make RE
the meta data, i.e. Title, Keywords and Description.

We need to allow other non development staff to update such fields, there
will be an administration panel available to do this.

Seen as the site is very popular and receives many hits we're looking very
carefully at CPU load and memory use, therefore need some advice regarding
the two ideas below...

- We create a TXT file for each ASP page within the site containing the
title, desccription and meta tags, we then serverside include this file into
the top of its relevant ASP page.

OR

- We store Title, Description and Keywords in our SQL Server (v7) table and
query the DB at the top of each ASP page to extract the data for these meta
fields.

Which would have the least impact on our server in terms of CPU etc, or
perhaps there's a better way?

Cheers, @sh

Combine both approaches:

Store the data in the db, and on the "add metadata" and "edit metadata"
admin pages, use Scripting.FileSystemObject to generate include files
using the new or updated information.

Eh? where is this?

May 23 '06 #5
@sh
Many thanks for your suggestions - I like the idea of checking an applicable
Application Variable for the page the user is on, if one doesn't exist the
page will query the DB to retrieve the details and set a new Application
Variable.

Then on each update of the keywords/title/meta data, I could force a
deletion of all Application Variables.

Would it be ok to write a new Application Variable per page (we're talking a
few hundred here) or somehow store them all within one? Perhaps an array of
some sort?

Cheers, @sh
<wo******@gmail.com> wrote in message
news:11**********************@j73g2000cwa.googlegr oups.com...

Mike Brind wrote:
@sh wrote:
> Guys,
>
> We're in the midst of building a new site and have some decisions to
> make RE
> the meta data, i.e. Title, Keywords and Description.
>
> We need to allow other non development staff to update such fields,
> there
> will be an administration panel available to do this.
>
> Seen as the site is very popular and receives many hits we're looking
> very
> carefully at CPU load and memory use, therefore need some advice
> regarding
> the two ideas below...
>
> - We create a TXT file for each ASP page within the site containing the
> title, desccription and meta tags, we then serverside include this file
> into
> the top of its relevant ASP page.
>
> OR
>
> - We store Title, Description and Keywords in our SQL Server (v7) table
> and
> query the DB at the top of each ASP page to extract the data for these
> meta
> fields.
>
> Which would have the least impact on our server in terms of CPU etc, or
> perhaps there's a better way?
>
> Cheers, @sh

Combine both approaches:

Store the data in the db, and on the "add metadata" and "edit metadata"
admin pages, use Scripting.FileSystemObject to generate include files
using the new or updated information.

Eh? where is this?

May 23 '06 #6
wo******@gmail.com wrote:
Mike Brind wrote:
Combine both approaches:

Store the data in the db, and on the "add metadata" and "edit
metadata" admin pages, use Scripting.FileSystemObject to generate
include files using the new or updated information.

Eh? where is this?


Where is what?
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
May 23 '06 #7
@sh wrote:
Many thanks for your suggestions - I like the idea of checking an
applicable Application Variable for the page the user is on, if one
doesn't exist the page will query the DB to retrieve the details and
set a new Application Variable.

Then on each update of the keywords/title/meta data, I could force a
deletion of all Application Variables.

Yes, that was the general idea.
Would it be ok to write a new Application Variable per page (we're
talking a few hundred here)
Ooh! Now we're getting into the territory where we might want to lean
more toward what Mike was suggesting (dynamic ssi pages).
or somehow store them all within one?
Perhaps an array of some sort?

However, if the size is not too big, then storing a free-threaded xml
domdocument object with your configuration data may be workable.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
May 23 '06 #8

wo******@gmail.com wrote:
Mike Brind wrote:
@sh wrote:
Guys,

We're in the midst of building a new site and have some decisions to make RE
the meta data, i.e. Title, Keywords and Description.

We need to allow other non development staff to update such fields, there
will be an administration panel available to do this.

Seen as the site is very popular and receives many hits we're looking very
carefully at CPU load and memory use, therefore need some advice regarding
the two ideas below...

- We create a TXT file for each ASP page within the site containing the
title, desccription and meta tags, we then serverside include this file into
the top of its relevant ASP page.

OR

- We store Title, Description and Keywords in our SQL Server (v7) table and
query the DB at the top of each ASP page to extract the data for these meta
fields.

Which would have the least impact on our server in terms of CPU etc, or
perhaps there's a better way?

Cheers, @sh

Combine both approaches:

Store the data in the db, and on the "add metadata" and "edit metadata"
admin pages, use Scripting.FileSystemObject to generate include files
using the new or updated information.

Eh? where is this?


Do you mean the "add metadata" and "edit metadata" pages? They are in
the administration panel mentioned in the OP.

--
Mike Brind

May 23 '06 #9

Mike Brind wrote:
wo******@gmail.com wrote:
Mike Brind wrote:
@sh wrote:
> Guys,
>
> We're in the midst of building a new site and have some decisions to make RE
> the meta data, i.e. Title, Keywords and Description.
>
> We need to allow other non development staff to update such fields, there
> will be an administration panel available to do this.
>
> Seen as the site is very popular and receives many hits we're looking very
> carefully at CPU load and memory use, therefore need some advice regarding
> the two ideas below...
>
> - We create a TXT file for each ASP page within the site containing the
> title, desccription and meta tags, we then serverside include this file into
> the top of its relevant ASP page.
>
> OR
>
> - We store Title, Description and Keywords in our SQL Server (v7) table and
> query the DB at the top of each ASP page to extract the data for these meta
> fields.
>
> Which would have the least impact on our server in terms of CPU etc, or
> perhaps there's a better way?
>
> Cheers, @sh
Combine both approaches:

Store the data in the db, and on the "add metadata" and "edit metadata"
admin pages, use Scripting.FileSystemObject to generate include files
using the new or updated information.

Eh? where is this?


Do you mean the "add metadata" and "edit metadata" pages? They are in
the administration panel mentioned in the OP.

--
Mike Brind

Oh oh sorry, thought it was some setting I didn't know of in IIS :)

May 24 '06 #10
@sh
>> or somehow store them all within one?
Perhaps an array of some sort?

However, if the size is not too big, then storing a free-threaded xml
domdocument object with your configuration data may be workable.


Now we're getting into an area I'm completely unfamiliar with!! Would it
really be devastating for performance to query the DB on each page load?

Another question a little off topic but related - I'm building the site
based largely on includes (for easier updating), is it bad practice to have
an include file including another include file? i.e. including a 'Header'
file into each site page, and the Header include calling another include
containing perhaps Meta data?

Appreciate your help!

Cheers, @sh
May 26 '06 #11
@sh wrote:
or somehow store them all within one?
Perhaps an array of some sort?
However, if the size is not too big, then storing a free-threaded xml
domdocument object with your configuration data may be workable.


Now we're getting into an area I'm completely unfamiliar with!!


While there is a definite learning curve I was able to learn how to deal
with xml by using the documentation for the msxml parser at
msdn.microsoft.com/library. However, it isn't necessary to use xml: it was
just a suggestion that would have made things a little easier IMO.

You could store the data in strongly structured arrays (don't use
thread-bound COM objects such as recordset or dictionary objects - you will
get the opposite performance result you are looking for). Or use Mike's
suggestion of generating the include files whenever the metadata changes.
Would
it really be devastating for performance to query the DB on each page
load?
:-)
How would I know? That answer can only be determined by testing. My gut feel
is that going out of process (querying the database) to get data which can
be cached in process is something to be avoided. However, your testing may
show that querying the database results in performance that is good enough.
Another question a little off topic but related - I'm building the
site based largely on includes (for easier updating), is it bad
practice to have an include file including another include file? i.e.
including a 'Header' file into each site page, and the Header include
calling another include containing perhaps Meta data?

No. The only caveat is to avoid doing things in one include file that have
already been done in a file included in the include file, such as executing
"Option Explicit" which raises an error if done more than once in a page, or
declaring variables more than once. If the "meta" include file consists
solely of functions (GetTitle, etc.) that are called by the page that
includes it, you should be safe from those types of errors. However, that is
not necessary, simply a suggestion.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
May 26 '06 #12
On Fri, 26 May 2006 06:59:16 -0500, Bob Barrows [MVP]
<re******@NOyahoo.SPAMcom> wrote:
@sh wrote:
or somehow store them all within one?
Perhaps an array of some sort?

However, if the size is not too big, then storing a free-threaded xml
domdocument object with your configuration data may be workable.


Now we're getting into an area I'm completely unfamiliar with!!


While there is a definite learning curve I was able to learn how to deal
with xml by using the documentation for the msxml parser at
msdn.microsoft.com/library. However, it isn't necessary to use xml: it
was
just a suggestion that would have made things a little easier IMO.

You could store the data in strongly structured arrays (don't use
thread-bound COM objects such as recordset or dictionary objects - you
will
get the opposite performance result you are looking for). Or use Mike's
suggestion of generating the include files whenever the metadata changes.


An array would be copied from the Application object in its entirety each
time it is accessed. I suspect this is also not the sort of performance
result he is looking for. :)

--
Justin Piper
Bizco Technologies
http://www.bizco.com/
May 26 '06 #13
Justin Piper wrote:

An array would be copied from the Application object in its entirety
each time it is accessed. I suspect this is also not the sort of
performance result he is looking for. :)


I did not mean a single array. I meant an array for each page. Or is that
relevant to your point?

Again, the performance result can only be measured by testing.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
May 26 '06 #14
On Fri, 26 May 2006 10:50:27 -0500, Bob Barrows [MVP]
<re******@NOyahoo.SPAMcom> wrote:
Justin Piper wrote:

An array would be copied from the Application object in its entirety
each time it is accessed. I suspect this is also not the sort of
performance result he is looking for. :)


I did not mean a single array. I meant an array for each page. Or is that
relevant to your point?

Again, the performance result can only be measured by testing.


My mistake. I read "strongly structured array" and thought you were
suggesting something along these lines:

Application("titles") = Array(Array("Page 1", "some data for page 1"), _
Array("Page 2", "some data for page 2"), _
... _
Array("Page 4,397,215", "silly, ain't
it?"))

--
Justin Piper
Bizco Technologies
http://www.bizco.com/
May 26 '06 #15

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

Similar topics

5
by: democratix | last post by:
Hi, I've only got a couple years experience developing for Access but have recently been experimenting with HTML/javascript for gui and client-side scripting, mysql for database and php for...
4
by: HeadScratcher | last post by:
We have written an application which splits up our customers data into their individual databases. The structure of the databases is the same. Is it better to create the same stored procedures in...
346
by: rkusenet | last post by:
http://biz.yahoo.com/rc/040526/tech_database_marketshare_1.html Interesting to see that database sales for windows is more than Unix.
3
by: reageer | last post by:
Hi all, I have a design question: I have a bunch of users (name, address, zip, etc.). They are assigned a card with a specific id. The only thing unique is this card id, or probably the...
10
by: Jim Devenish | last post by:
I have a split front end/back end system. However I create a number of local tables to carry out certain operations. There is a tendency for the front end to bloat so I have set 'compact on...
8
by: supasnail | last post by:
I have a happily working set of asp pages which read from the database via include file "./_private/include/database.mdb". However, when I try to gain access to this database on pages one folder...
9
by: TC | last post by:
Like a lot of database developers, I often choose Jet for the back- end. I'm starting to worry about what will happen when Jet is deprecated. Ostensibly, Jet users like me must switch to SQL Server...
3
by: Paul | last post by:
Hi all, I have posted a question in the Database design and theory ng, but I expect a lot of you will have suggestions to help me (and that ng doesn't seem very active). The post is here: ...
24
by: sonos | last post by:
Hi, I am working on a program to archive data to disk. At what point is it best to use a relational database like MySQL as the backend instead of a C program alone? Thanks to any and all...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
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...

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.