locked
SqlDependency RRS feed

  • Question

  •  

    Hi,

          we are planning to use sqldependency (2005 Notification) for our cache invalidations. I just wanted to know is it scalable and reliable. Any surprises to look for any known issues esp reg. scalability. Currenlty we are using file based dependency.

    Tuesday, January 29, 2008 9:47 AM

All replies

  • I haven't actually used the class, but considered it.  It seemed to be too big a risk for our purposes.

     

    I would imagine that the problems would come with concurrency, and resource locking.  Something changes, quickly followed by something else changing.  This has an issue that the first change might be in progress, so you may have to deal with queueing the changes.

     

    Also, what happens if there is a cache invalidation that occurs part way through a client querying the data in the cache.  Does this request need to produce a snapshot, does locking occur?  If locking occurs, that would be a definite candidate for scalability problems, I'd imagine.

     

    The other situation is that of traffic.  Are all the cache invalidations by the SqlDependency object valid at that point, or the solution more in need of a specific pull solution?  Are you pushing data to the cache that may never be used, or may be invalidated more often than it is used?  If so, you are creating unnecessary traffic.  If changes are rare and all data is used at least once then a SqlDependency object may be appropriate.

     

    Scalability, again without having used the class, I wouldn't be 100%, but the cache could be a bottleneck if a lot of requests for cache updates are received.

     

    If you read the MSDN information on the SqlDependency object, you will find some good information on what implications choosing a particular caching mechanism will have.  I suggest reading that, as I can't remember all of it off the top of my head.

     

    I hope this helps you get started,

     

    Martin Platt.

    Tuesday, January 29, 2008 11:27 PM
  • Ravi,

    I've not pushed NS to the extreme but have had good success in limited use. However, it may affect your direction to learn NS is being pulled from SQL 2008:

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2006061&SiteID=1
    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2348027&SiteID=1

    Jeff...
    Wednesday, January 30, 2008 3:54 PM