Keeping Application Cache in synce

  • The current request is to have buckets of cache so when multiple people are looking at specific data statically we have a manager to tell the code that something within a bucket changed and to reload other people's screen. The idea here is to look at a smaller table so that we are not querying the larger tables to see when things change. This is extra overhead.

    On a Save sproc now we have to update the sync manager when we save the record. Seems a bit wasteful to me. We will loose performance on the save and potentially get locks on that table. I don't see another avenue though. Has anyone done a project that I can pull off of on this?

    Edit: This will not be a website. This is a windows form app that will probably support 20-40 concurrent users. I would think 40 would be max. The tables are heavy. Meaning that we could be looking at gigs of data. Better if I speak to the number of rows. The tables they want to know if the cache is in sync will have roughly a 4 million rows within a year of application start up. Here is a website I found that describes exactly what I am after

    http://sqlserverperformance.idera.com/memory/forget-application-caching/

    They go into the benefits and cons a bit, but no real context for data models.

    The model that we are coming up with is similar to this

    A Sync Manager table

    PK int sync Manager Id

    Snyc Manager type smallint which is the entity within the bucket. So each entity will have there own ID

    Owner ID uniqueidentifier (required datatype to match existing data structure) This is what it was opened from. Where in the tree it was opened to know the control level

    TimeStamp - This will need to be updated whenever there is a change to know that something in cache is out of sync and needs to be refreshed

    It is really managing two tables all the time. the OLTP table and the Sync table to make sure the cache is up to date

    Hopefully this helps a bit

  • I suspect you're over engineering this a bit. A good cache manager will handle completely (or mostly facilitate) the monitoring and re-caching of data that has changed. In terms of .NET there are technological alignments with SQL Server. What's the application language?

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • The applications language is C#. This is not something we are rolling out internally. This is going to clients.

  • There are built-in caching frameworks from Microsoft for ASP.NET as well as Windows Forms that are mostly configuration-based. Depending on your requirements you may not have to write one lick of home-grown code to implement a robust caching solution, certainly nothing custom in the way of coding in data layer.

    Caching in .NET Framework Applications (.NET Framework 4.5)

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply