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

Caching design question

I need to implement caching in a web application and have come up against a
design issue which I would like some advice on. Am using CLASSIC ASP...

The web application is a "business to business" application. So the users
who log on belong to many different companies.

There are system wide settings, for example financial exchange rates etc.

There are "business" settings, so for example colours. So all users that
belong to Business A will see a blue background, and those in Business B
will see a green background.

There are "user" settings, so for example font size.

As far as caching is concerned, the system wide settings should go in the
Application() cache. These will be the same for ALL users.

The "user" settings should presumably go in the Session() cache; they're
peculiar that an individual and you don't want them hanging around in RAM
for too long, so they can expire when the session expires.

But, the problem I have is knowing where to put the Business settings. If I
put them in the Session() cache then there will be X number of copies of the
same data and I can see this soon consuming a lot of memory. The
alternative is to put them in the Application() cache so that there is a
single copy, but the problem here is that it will be stored in memory and
there can be an awful lot of businesses...

Is there an alternative that I've not considered? I guess ideally I'd like
to put things in the Application() cache with a Time To Live value (rather
like a cookie or a DNS record has), but I don't think that this is
possible..

Any advice/suggestions would be most appreciated.

Thanks

Griff
Apr 28 '06 #1
7 1304

"Griff" <ho*****@the.moon> wrote in message
news:ef*************@TK2MSFTNGP02.phx.gbl...
I need to implement caching in a web application and have come up against a design issue which I would like some advice on. Am using CLASSIC ASP...

The web application is a "business to business" application. So the users
who log on belong to many different companies.

There are system wide settings, for example financial exchange rates etc.

There are "business" settings, so for example colours. So all users that
belong to Business A will see a blue background, and those in Business B
will see a green background.

There are "user" settings, so for example font size.

As far as caching is concerned, the system wide settings should go in the
Application() cache. These will be the same for ALL users.

The "user" settings should presumably go in the Session() cache; they're
peculiar that an individual and you don't want them hanging around in RAM
for too long, so they can expire when the session expires.

But, the problem I have is knowing where to put the Business settings. If I put them in the Session() cache then there will be X number of copies of the same data and I can see this soon consuming a lot of memory. The
alternative is to put them in the Application() cache so that there is a
single copy, but the problem here is that it will be stored in memory and
there can be an awful lot of businesses...

Is there an alternative that I've not considered? I guess ideally I'd like to put things in the Application() cache with a Time To Live value (rather
like a cookie or a DNS record has), but I don't think that this is
possible..

Any advice/suggestions would be most appreciated.

Thanks

Griff


How many users do you expect to have at any one time?
The reason you're not doing all this stuff with a database is?
How many settings specific to a business are there?
Is this a piece of software you intend to sell or is it your (or your
client's) business that will be offering the service?

Apr 28 '06 #2

Anthony Jones wrote:
"Griff" <ho*****@the.moon> wrote in message
news:ef*************@TK2MSFTNGP02.phx.gbl...
I need to implement caching in a web application and have come up against

a
design issue which I would like some advice on. Am using CLASSIC ASP...

The web application is a "business to business" application. So the users
who log on belong to many different companies.

There are system wide settings, for example financial exchange rates etc.

There are "business" settings, so for example colours. So all users that
belong to Business A will see a blue background, and those in Business B
will see a green background.

There are "user" settings, so for example font size.

As far as caching is concerned, the system wide settings should go in the
Application() cache. These will be the same for ALL users.

The "user" settings should presumably go in the Session() cache; they're
peculiar that an individual and you don't want them hanging around in RAM
for too long, so they can expire when the session expires.

But, the problem I have is knowing where to put the Business settings. If

I
put them in the Session() cache then there will be X number of copies of

the
same data and I can see this soon consuming a lot of memory. The
alternative is to put them in the Application() cache so that there is a
single copy, but the problem here is that it will be stored in memory and
there can be an awful lot of businesses...

Is there an alternative that I've not considered? I guess ideally I'd

like
to put things in the Application() cache with a Time To Live value (rather
like a cookie or a DNS record has), but I don't think that this is
possible..

Any advice/suggestions would be most appreciated.

Thanks

Griff


How many users do you expect to have at any one time?
The reason you're not doing all this stuff with a database is?
How many settings specific to a business are there?


Also, are they all style related?

--
Mike Brind

Apr 28 '06 #3
To answer Anthony's question (and hopefully expand upon it):
--------------------------------------------------------------

There are up to 1000 businesses and ~ 100,000 registered users. We have
upwards of 150 users on the system at any one time.

All the data is of course held as durable data in the database. This
database is on it's separate server. Caching the this soft of data would
cut down on unnecessary slow network round trips to the database server and
allow the DB to concentrate on working on the queries that can't be cached.

As to how many settings - something like 30 settings that can be held in a
string. There are of other more data-set style bits of data that can be
cached (e.g. allowable cost centres etc) which could go into select boxes
etc.

This is an existing application that we host.

To answer Mike Brind's questin
--------------------------------

Many of them are style related and are used to programatically generate a
CSS style sheet. Others are to do with functionality access - business A
can run reports, business B can't etc. Also (as mentioned above) some of
this information is array-type information, for example a list of cost
centres for a business, or a list of delivery addresses etc.

Griff


Apr 28 '06 #4

"Griff" <ho*****@the.moon> wrote in message
news:OT**************@TK2MSFTNGP05.phx.gbl...
To answer Anthony's question (and hopefully expand upon it):
--------------------------------------------------------------

There are up to 1000 businesses and ~ 100,000 registered users. We have
upwards of 150 users on the system at any one time.

All the data is of course held as durable data in the database. This
database is on it's separate server. Caching the this soft of data would
cut down on unnecessary slow network round trips to the database server and allow the DB to concentrate on working on the queries that can't be cached.
As to how many settings - something like 30 settings that can be held in a
string. There are of other more data-set style bits of data that can be
cached (e.g. allowable cost centres etc) which could go into select boxes
etc.

This is an existing application that we host.

To answer Mike Brind's questin
--------------------------------

Many of them are style related and are used to programatically generate a
CSS style sheet. Others are to do with functionality access - business A
can run reports, business B can't etc. Also (as mentioned above) some of
this information is array-type information, for example a list of cost
centres for a business, or a list of delivery addresses etc.

Griff


The chances are then there are few concurrent users actually from the same
business.

Stick the business settings in the session for the user. Shove more memory
in the server if necessary but I doubt 150 users would trouble a reasonable
well specified server.
Anthony.
Apr 28 '06 #5
Okay - thanks for your time.
The chances are then there are few concurrent users actually from the
same
business.

Stick the business settings in the session for the user. Shove more
memory
in the server if necessary but I doubt 150 users would trouble a
reasonable
well specified server.
Anthony.

Apr 28 '06 #6
One quick question

What number would have made you suggest using the application rather than
the session object?

Griff
Apr 28 '06 #7

"Griff" <ho*****@the.moon> wrote in message
news:u7****************@TK2MSFTNGP03.phx.gbl...
One quick question

What number would have made you suggest using the application rather than
the session object?

Griff

How long is a piece of string, there are too many variables.

The fact that it is your server imeadiately means by far the most cost
effective way to maintain performance is beef up the hardware.

It's also the ratio of concurrent users to the business they are from which
reduces the likely hood of caching business settings separately in the
application object would really have much benefit.

At a very rough guess if you had like 600 concurrent users with a 10:1
business ratio then perhaps the additional complexity of managing separate
business settings might be warranted.

In this case I would consider a Free Threaded XML DOM as a cache for each
business stored in the Application object. Have an attribute on the
document element specify the expiry. Use a VB Script class in an ASP
include to wrap the accessing of values and the refreshing of the content.

Perhaps the first thing I would do is confirm that accessing all this from
the DB is really a problem. Again adding hardware may help, if the DB
server is physically near enough perhaps a couple of dedicated 1Gb network
cards, cost peanuts but has massive impact on server round trip performance.
Anthony.
Apr 28 '06 #8

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

Similar topics

10
by: Jon Maz | last post by:
Hi, My goal is to take the entire html/javascript stream spat out by .aspx pages and save them as simple strings in a database (for caching purposes). I'm not sure how I can get hold of this...
2
by: Welman Jordan | last post by:
Hello, I met with a tough problem when making my pages. Please help. To make the problem short, i write down what i want here first, and then explain my situation in details. How can I...
13
by: tshad | last post by:
How do we handle Caching in IE? It seems that my system works fine in Mozilla and Netscape when I make changes. But in IE the changes are not brought across when someone has been to the site...
0
by: Chris | last post by:
I've been playing with the fragment caching and it seems to work fine. I have a user control that I set to cache. The user control has a few text boxes and a drop down list box populated from a...
1
by: Chu | last post by:
Hello All- I'm writing a game using asp.net (c#). The game is a browser-based Role Playing Game. I'm trying to determine the best way to design the game with scalability in mind. The Player...
1
by: Kevin Burrowes | last post by:
I need to implement caching for a large enterprise application and we are planning to use the newest Caching Application Blocks. (Enterprise Library Jan. 2006) We want to cache Business Entities...
3
by: Gary W. Smith | last post by:
I had a couple questions about data caching. We have a site that gets a huge amount of traffic to a few specific pages that have a lot of data on them (300k hits/hour during peak, about 6-10 data...
14
by: Rowan | last post by:
What is the best approach to caching database results. example say i'm doign an update on several entries which i've loaded into an array. I want to allow the user to click through and up date each...
2
by: Ken Fine | last post by:
I have a question about ASP.NET output caching. I want to use screen scraping as a temporary hack to pull in some complex Classic ASP-rendered content into some ASP.NET pages: protected String...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.