473,413 Members | 1,727 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,413 software developers and data experts.

Application Vars .vs. SQL Lookups

I have an application that uses SQL extensively. However some of what it
uses SQL for (the results) are fairly static and change in the database very
rarely. Would it be more efficient to store this information in application
variables rather than doing SQL queries each time? Its a pretty heavily
utilized application. Would application variables be able to handle the
traffic?

Thanks!
Jon
Jul 21 '05 #1
3 1343
Jon Glazer wrote:
I have an application that uses SQL extensively. However some of
what it uses SQL for (the results) are fairly static and change in
the database very rarely. Would it be more efficient to store this
information in application variables rather than doing SQL queries
each time? Its a pretty heavily utilized application. Would
application variables be able to handle the traffic?

Yes, as long as you aren't planning to store ADO objects (such as
recordsets) in application. Convert the data to a string (GetString) or
array (GetRows) and store that in application.
http://www.aspfaq.com/show.asp?id=2053

Bob Barrows
--
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.
Jul 21 '05 #2
You'll need to test out whatever you do. If there aren't too many app vars,
it will perform better. But if there is a lot of information, and/or your
web server is poor hardware, and/or your SQL server is very fast, you may
get better performance pulling that information from SQL than bloating it
into the application object.

--
Ben Strackany
www.developmentnow.com
"Jon Glazer" <jg***************@adconn.com> wrote in message
news:%b*******************@fe2.columbus.rr.com...
I have an application that uses SQL extensively. However some of what it
uses SQL for (the results) are fairly static and change in the database very rarely. Would it be more efficient to store this information in application variables rather than doing SQL queries each time? Its a pretty heavily
utilized application. Would application variables be able to handle the
traffic?

Thanks!
Jon

Jul 21 '05 #3
Jon Glazer wrote:
I have an application that uses SQL extensively. However some of what it
uses SQL for (the results) are fairly static and change in the database very
rarely. Would it be more efficient to store this information in application
variables rather than doing SQL queries each time? Its a pretty heavily
utilized application. Would application variables be able to handle the
traffic?


Almost certainly. See http://aspfaq.com/show.asp?id=2053 for more
details about what Bob Barrows' said.

It's very effective to store commonly-used data in string format in the
Application object. IIRC http://aspfaq.com/ does just that to speed
response.

Just make sure that the data is initially loaded in the
Application_OnStart event (in global.asa) and that the relevant
Application variables are updated when the associated data is changed in
the database.

Here's a technique that stores cached data in the Application object.
http://www.google.com/groups?q=alter...-pc.org&rnum=1

In this technique current data is stored in one of two Application
variables: while one variable is being read (copied) by ASP pages the
other variable is empty and available for update. This eliminates any
waiting while the data is copied from the database to the Application
variables and eliminates any need for readers to lock the Application
object.

Good Luck,
Michael D. Kersey
Jul 21 '05 #4

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

Similar topics

0
by: james | last post by:
I am new to php and need some help getting the session variables into include files. (after-thought, Sorry for the drawn out post but I really, really need help....;) Here's what I'm doing.. ...
1
by: Tim | last post by:
Hi, We are downloading a few thousand rows of data for users to choose from and need to speed up the operation. The data is related in four levels. The current design allows the user to select...
1
by: Russell | last post by:
Hi, I've been reading a lot about not using lookups in tables lately. Thus far, what I've been able to understand from my reading is this: - Do not use lookup fields in tables because they...
50
by: Jay Balapa | last post by:
Hello, Currently my application has three tiers- 1. Presentation Layer (Asp.Net / Win Forms/ Pocket PC UI.) This predominantly contains User Controls, Custom Controls and Win/Web Forms. I...
0
by: Brett | last post by:
I am working with vb.net in a asp.net application. I have created a config file in xml format. The goal is to be able to change the config file without having to recompile the entire...
2
by: Jassim Rahma | last post by:
hello, how can i write and read a global variable for the entire application in C#? Many Thanks, Jassim Rahma *** Sent via Developersdex http://www.developersdex.com ***
0
by: =?Utf-8?B?SkhhbGV5?= | last post by:
Our system is: IIS Server: dual Intel Xeon 2.80 GHz, 4 GB Ram Windows Server 2003 SP2 IIS 6.0 SQL Server: dual Intel Xeon 2.80 GHz, 4 GB Ram (separate server) Windows Server 2003 SP2 SQL...
19
RMWChaos
by: RMWChaos | last post by:
Previously, I had used independent JSON lists in my code, where the lists were part of separate scripts. Because this method did not support reuse of a script without modification, I decided to...
6
by: goodguyjam | last post by:
Hi all, I'm having trouble with mysql. I've just finished my php coding for HTTP authentication and with some help am now getting a login window pop up whenever I click on a link on my website...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.