By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,969 Members | 2,422 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,969 IT Pros & Developers. It's quick & easy.

Storing application specific information

P: n/a
I have some data that is been retrieved from a call to sql server stored
procedure that I want to store for a period of time in a web farm
architecture. I want to minimize the calls to sql server as much as
possible. Storing it in application cache will result the calls to be made
if the users are bounced from one server to another. But is this the best
resolution or is there any other methodology that I can use which will be
more optimized for my purpose?

Any help on this matter is greatly appreciated.
Nov 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
It depends on how the data is used. Is it common to all users, or is
different data retrieved for each user?
If it is common to all users, using the ASP.NET Cache is probably the
best option. Yes, it will be retrieved once for each server in a farm,
but that is a pretty low cost to pay.
If the data is specific to each user, you should probably use
out-of-process Session. You can configure session to use the Session
State service or SQL Server in your web.config file. Programmatically,
you just use the Session object like you normally do. With
out-of-process session, it wont matter which server in the web cluster
the user is on; their data will be available.

Joshua Flanagan
http://flimflan.com/blog

kanones wrote:
I have some data that is been retrieved from a call to sql server stored
procedure that I want to store for a period of time in a web farm
architecture. I want to minimize the calls to sql server as much as
possible. Storing it in application cache will result the calls to be made
if the users are bounced from one server to another. But is this the best
resolution or is there any other methodology that I can use which will be
more optimized for my purpose?

Any help on this matter is greatly appreciated.

Nov 19 '05 #2

P: n/a
Thanks for the reply. The data is not user specific so I was leaning towards
application cache but I was concerned because of the web farm architecture
and hence the data being duplicated on the servers. Have you run across any
documentaion on performance metrics for this? Is State Server ONLY for
session/user specific data?

Thanks
Kan

"Joshua Flanagan" wrote:
It depends on how the data is used. Is it common to all users, or is
different data retrieved for each user?
If it is common to all users, using the ASP.NET Cache is probably the
best option. Yes, it will be retrieved once for each server in a farm,
but that is a pretty low cost to pay.
If the data is specific to each user, you should probably use
out-of-process Session. You can configure session to use the Session
State service or SQL Server in your web.config file. Programmatically,
you just use the Session object like you normally do. With
out-of-process session, it wont matter which server in the web cluster
the user is on; their data will be available.

Joshua Flanagan
http://flimflan.com/blog

kanones wrote:
I have some data that is been retrieved from a call to sql server stored
procedure that I want to store for a period of time in a web farm
architecture. I want to minimize the calls to sql server as much as
possible. Storing it in application cache will result the calls to be made
if the users are bounced from one server to another. But is this the best
resolution or is there any other methodology that I can use which will be
more optimized for my purpose?

Any help on this matter is greatly appreciated.

Nov 19 '05 #3

P: n/a
I don't see duplication of the data on 2 servers as a problem, unless
you expect the data to be updated by users during the execution of the
application. Then it becomes a big problem, as you try to keep the
servers in synch. Using session wouldn't help solve that problem either.
I don't know any specific performance documentation, but I'm pretty sure
you would not want to use the State Server for application wide data,
since it would cause the data to be repeated and stored individually for
each user session.
Remember, you usually only want to cache data results when it more
expensive to retrieve them from the original source. If you start
making a bunch of trips to retrieve the cached data, or use a lot of
memory for it (copying the same values to every session on every
server), you are probably hurting yourself more than helping.
I would not be afraid to make a single call to populate the ASP.NET
cache on each server on a web farm.

kanones wrote:
Thanks for the reply. The data is not user specific so I was leaning towards
application cache but I was concerned because of the web farm architecture
and hence the data being duplicated on the servers. Have you run across any
documentaion on performance metrics for this? Is State Server ONLY for
session/user specific data?

Thanks
Kan

"Joshua Flanagan" wrote:

It depends on how the data is used. Is it common to all users, or is
different data retrieved for each user?
If it is common to all users, using the ASP.NET Cache is probably the
best option. Yes, it will be retrieved once for each server in a farm,
but that is a pretty low cost to pay.
If the data is specific to each user, you should probably use
out-of-process Session. You can configure session to use the Session
State service or SQL Server in your web.config file. Programmatically,
you just use the Session object like you normally do. With
out-of-process session, it wont matter which server in the web cluster
the user is on; their data will be available.

Joshua Flanagan
http://flimflan.com/blog

kanones wrote:
I have some data that is been retrieved from a call to sql server stored
procedure that I want to store for a period of time in a web farm
architecture. I want to minimize the calls to sql server as much as
possible. Storing it in application cache will result the calls to be made
if the users are bounced from one server to another. But is this the best
resolution or is there any other methodology that I can use which will be
more optimized for my purpose?

Any help on this matter is greatly appreciated.

Nov 19 '05 #4

P: n/a
Thanks for the reply. It looks like application cache is the way to go. I
was reading up on it specifically with regards to amount of information that
is ideal to store. I was planning on saving a hashtable with about 50
Key-Value pairs in it. Is this a good way ? Or should serialization of the
data be considered? Have you run into any articles with size limitation for
the application cache?

Appreciate a reply.

"Joshua Flanagan" wrote:
I don't see duplication of the data on 2 servers as a problem, unless
you expect the data to be updated by users during the execution of the
application. Then it becomes a big problem, as you try to keep the
servers in synch. Using session wouldn't help solve that problem either.
I don't know any specific performance documentation, but I'm pretty sure
you would not want to use the State Server for application wide data,
since it would cause the data to be repeated and stored individually for
each user session.
Remember, you usually only want to cache data results when it more
expensive to retrieve them from the original source. If you start
making a bunch of trips to retrieve the cached data, or use a lot of
memory for it (copying the same values to every session on every
server), you are probably hurting yourself more than helping.
I would not be afraid to make a single call to populate the ASP.NET
cache on each server on a web farm.

kanones wrote:
Thanks for the reply. The data is not user specific so I was leaning towards
application cache but I was concerned because of the web farm architecture
and hence the data being duplicated on the servers. Have you run across any
documentaion on performance metrics for this? Is State Server ONLY for
session/user specific data?

Thanks
Kan

"Joshua Flanagan" wrote:

It depends on how the data is used. Is it common to all users, or is
different data retrieved for each user?
If it is common to all users, using the ASP.NET Cache is probably the
best option. Yes, it will be retrieved once for each server in a farm,
but that is a pretty low cost to pay.
If the data is specific to each user, you should probably use
out-of-process Session. You can configure session to use the Session
State service or SQL Server in your web.config file. Programmatically,
you just use the Session object like you normally do. With
out-of-process session, it wont matter which server in the web cluster
the user is on; their data will be available.

Joshua Flanagan
http://flimflan.com/blog

kanones wrote:

I have some data that is been retrieved from a call to sql server stored
procedure that I want to store for a period of time in a web farm
architecture. I want to minimize the calls to sql server as much as
possible. Storing it in application cache will result the calls to be made
if the users are bounced from one server to another. But is this the best
resolution or is there any other methodology that I can use which will be
more optimized for my purpose?

Any help on this matter is greatly appreciated.

Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.