Database Access vs Turning on SessionState

C

CW

My asp application currently does not rely on session state at all, and I
have turned it off.

The function that I need to implements include a customer specific price
list. I am thinking of cacheing the price list (which is different for each
customer) in session variables rather than retrieving a copy of the customer
price list each time.

On one hand, with the database approach, each time a customer browses a
price list, it entails not only a round trip to the server, but also a round
trip access to the database server. On the other hand, with the session
state approach, if the same customer goes to a different page, and then
comes back to the price list url, the page can loads information directly
from cache stored in session.

Which approach is better?
 
G

Guest

If the price list is big I would prefer retrieving it from the database, rather than stroing it in servers' memory using Sessions

Rasika Wijayaratne
 
B

Bryan Donaldson

third option - an Application-level object used to cache requested price
lists for some time - return trips from the same user (or different user)
get the cached lists, new requests hit the database and then are cached for
later requests.

Store the cached lists as long as you think necessary.
 
C

CW

Thanks for the suggestion. I have thought about using application to cache
the data (or indeed using Cache object).

The price list is quite big (a few hundred items for each customer and every
customer has a different price list). I am just concerned that storing the
data on the web server is going to take up too much memory. On the other
hand, Cache might not be a bad idea because if I understand it correctly,
the cache gets emptied when memory level becomes low.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top