So, I'm giving a talk next week in Dallas at VSLive and I'll be talking about Velocity. So, I'm building demos to talk about caching and I'm using SDS (MS... please keep the servers up for my talk).
Anyway, I'm using the Calendar of Events data I've written about in early blog entries and doing a very simple random grab of data. I get a random year's worth of events from SDS for a random web site. Display statistics and repeat. Now, nothing here surprise me, but I thought I'd share.
Without caching, I consistently average about 300 milliseconds to query SDS and return data. That's for a query that looks like this:
from c in entities where (c["WebSiteID"] == "W1" || c["WebSiteID"]=="W1") && (((c["EventDate"] > DateTime("2017-01-01T00:00:00") && c["EventDate"] < DateTime("2017-01-01T00:00:00") ) && c.Kind=="CalendarEntry") || c.Kind=="WebSite") orderby c["WebSiteID"] select c
With caching, the results are far more dramatic. By 192 calls, I've actually had 117 cache hits, 60.94%. And a cache hit takes < 1 millisecond, which means that my average duration is down to a little over 115 milliseconds
By 2700 hits, my cache ratio hits almost 97% and the average is almost 10 milliseconds.
Granted, this demo is skewed and not totally realistic and isn't doing much dumping of data out of the cache, but it does show how beneficial caching is. In more realistic terms, cache hits on a well designed system should be over 80% and will have a dramatic impact on scalability.