SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Keeping Application Cache in synce


Keeping Application Cache in synce

Author
Message
JKSQL
JKSQL
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1856 Visits: 702
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
Orlando Colamatteo
Orlando Colamatteo
SSC-Dedicated
SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)

Group: General Forum Members
Points: 38694 Visits: 14411
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
JKSQL
JKSQL
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1856 Visits: 702
The applications language is C#. This is not something we are rolling out internally. This is going to clients.
Orlando Colamatteo
Orlando Colamatteo
SSC-Dedicated
SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)

Group: General Forum Members
Points: 38694 Visits: 14411
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search