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

Cache and Carry

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....
Nov 18 '05 #1
2 1778
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)

On Wed, 25 Aug 2004 10:09:52 -0500, "Harry Simpson"
<hs*******@nospamphgt.net> wrote:
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,

--
Scott
http://www.OdeToCode.com

Nov 18 '05 #2
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

"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:i1********************************@4ax.com...
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)

On Wed, 25 Aug 2004 10:09:52 -0500, "Harry Simpson"
<hs*******@nospamphgt.net> wrote:
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,

--
Scott
http://www.OdeToCode.com

Nov 18 '05 #3

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

Similar topics

3
by: Nel | last post by:
Hi! I am trying to prevent a browser going back to a logon screen and any user being able to refresh (and the browser re-submits the post data). I understand that the following should work. ...
11
by: shank | last post by:
Is it possible to stop 1 single form field from being cached? I would like all the name and address fields to be cached by Internet Explorer, but not the credit card field. How is that done?...
0
by: Bryan Parkoff | last post by:
I break one U_WORD variable into two U_BYTE variables. I prefer to manipulate two U_BYTE variables instead of one U_WORD variable using Carry. Please look at my example using U_WORD variable...
16
by: archilleswaterland | last post by:
Hi, I am using a compiler that does not support long int (32 bits) so I am using 2 int's to do the work my problem int a; int b; int c;
3
by: martin | last post by:
Hi, I am storing a dataset in cache, which is happening fine. I can easily retrive it at postback from the cache, cast it to a dataset and reuse it. However I have specified that the cache...
14
by: Tom.PesterDELETETHISSS | last post by:
Hi, I think this question requires an in depth understanding of how a browser cache works. I hope I can reach an expert here. I may have found a quirk in the asp.net documentation or I don't...
5
by: campbellbrian2001 | last post by:
I'm trying to get the "Carry data over to new record" code to work from Allen Browne's site: http://allenbrowne.com/ser-24.html I follwed the instruction explicitly and somethings not working......
17
by: Hugh | last post by:
I would like to perform an addition without carrying of two integers... I've got no idea how to do this in python, although I've been using it for web/cgi/db work for a few years now. Any help...
3
chunk1978
by: chunk1978 | last post by:
hi there... i'm trying to make one text field contain the value of another... i'm assuming there's a really simple solution... here's a code i quickly wrote to further explain my issue: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...

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.