Cache and Carry

Discussion in 'ASP .Net' started by Harry Simpson, Aug 25, 2004.

  1. 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....
     
    Harry Simpson, Aug 25, 2004
    #1
    1. Advertising

  2. Harry Simpson

    Scott Allen Guest

    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"
    <> 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
     
    Scott Allen, Aug 25, 2004
    #2
    1. Advertising

  3. 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:...
    > 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"
    > <> 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
    >
     
    Harry Simpson, Aug 25, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jan Kindt
    Replies:
    1
    Views:
    1,504
    Jim Lewis
    Sep 17, 2003
  2. Tuukka Toivonen

    Using carry-in adders with Synopsys

    Tuukka Toivonen, Dec 1, 2003, in forum: VHDL
    Replies:
    3
    Views:
    1,526
    Ian Poole
    Dec 2, 2003
  3. Rune Christensen
    Replies:
    4
    Views:
    9,923
    David R Brooks
    Jan 22, 2005
  4. Damien Bardon

    Get the carry with add operator

    Damien Bardon, Mar 20, 2006, in forum: VHDL
    Replies:
    5
    Views:
    4,892
    Mike Treseler
    Mar 21, 2006
  5. Antryg Bogus Address
    Replies:
    2
    Views:
    103
    Paul Stickney
    Jan 5, 2008
Loading...

Share This Page