Cache and Carry

H

Harry Simpson

If anyone can chime in on these questions, I'd sure appreciate it.

1. How does the cache block fit in with the UIP Block - Is the "state"
managed there handled any differently with the CAB included? Do they
coexist?

2. Is Singleton the kind of default storage method relating to application
wide memory - Is it different in web vs Win apps?

3. Should we just use the ASPNET cache for web apps and the CAB for Win
apps?

4. What's the advantage of using SQL Server as a cache since you still have
to hit the database....just to aviod multiple processing of data?

5. Is the CAB only for "smart clients" and not for WinForm apps?

6. ASPNET cache - saved on server and available application wide? How does
it differentiate between sessions. Must the cache data saved only pertain
to global type information?

7. Can the CAB update cached items? I was under the impression that when the
data in cache got stale, you'd simply flush the cache and reload with all
new data results. A co-worker said he thought the cache itself should be
updateable ie individual records within the cache updated....course if you
did that the original database would not be synced....
 
S

Scott Allen

Hi Harry:

I'm afraid I'm not extremely familiar with the UIP/CAB blocks, but I
know you've asked before and have not gotten an answer, so let me
throw in two cents on some questions.. (see inline)

If anyone can chime in on these questions, I'd sure appreciate it.

1. How does the cache block fit in with the UIP Block - Is the "state"
managed there handled any differently with the CAB included? Do they
coexist?

2. Is Singleton the kind of default storage method relating to application
wide memory - Is it different in web vs Win apps?

With a singleton you should have only one instance of a class for the
entire application to access. This is true for both web apps and
WinForms. A cache is generally implemented as a singleton.
3. Should we just use the ASPNET cache for web apps and the CAB for Win
apps?

If you are writing a class library that needs to work in both web and
WinForm applications, the best approach is to abstract away where you
are caching the data. Encapsulate the details of where the cached data
is actually 'stored into' and 'retrieved from' in a class. This is
essentially what the CAB provides.
4. What's the advantage of using SQL Server as a cache since you still have
to hit the database....just to aviod multiple processing of data?

It does depend on the application and what the application does. If
you cache the results of 60 seconds of computation into a single row
in the database then SQL caching might be a huge win. In other cases
SQL caching might slow an application down. This is one of those areas
where you need to measure and test in a specific environment with an
application.

Also not that a SQL Server on the local machine might be faster than a
remote server. It would avoid the network hop. It could also use the
shared memory provider and avoid the TCP/IP stack altogether. Again,
this is something that has to be tested and measured for a specific
app to make sure it's an overall win.
5. Is the CAB only for "smart clients" and not for WinForm apps?

No, I believe it can be used anywhere.
6. ASPNET cache - saved on server and available application wide? How does
it differentiate between sessions. Must the cache data saved only pertain
to global type information?

ASPNET cache is saved on the server and is application wide. It does
not differentiate between sessions - all users will see the same
result for a given cache key unless the underlying data changes.

You can store per-user data in the cache, but you'll need to be
careful. You could, for example, prefix the cache key with a user ID
of some sort to ensure each user only sees thier copy of the cached
data.
7. Can the CAB update cached items? I was under the impression that when the
data in cache got stale, you'd simply flush the cache and reload with all
new data results. A co-worker said he thought the cache itself should be
updateable ie individual records within the cache updated....course if you
did that the original database would not be synced....

HTH,
 
H

Harry Simpson

Scott,

That really did help! Really glad to get a response. I've been unable to
get another point of view from the Cache Block site itself....seemingly the
place to get such a response eh.

I form an eval in my head and your responses confirm some of the ideas I
had.


Again, Thanks!

Harry
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top