ClickAider

Faster pages with memcached caching

Memcached caching is used by many sites to improve scalability. Facebook is reputed to have 3 terabytes of memcache storage distributed across 200 servers. We recently added memcached based caching of Mergelab public feeds. This post is intended to share with other developers some of the existing Rails caching techniques and tools that we used.

Read more on the Mergelab blog

1 Comment so far
Leave a comment

Hijacking the post for a moment to serve devs outside of the world of Rails: .NET developers looking to do the same things in an ASP.NET ecosystem should look at the ASP.NET 2.0 caching API.

In a Facebook/Mergelabs scenario, where users are continually updating the DB, you probably DON’T want a database triggered cache invalidation/SqlCacheDependency which refreshes cache on changes to the underlying datasource. .NET/MS SQL Server will give you that flexibility; if the memcache docs are to believed, MySQL query caching does not.

Best if you have the time: ASP.NET 2.0 allows you to inherit and extend the CacheDependency class: you can set your own dependencies/triggers based around the particular object structures and needs of your custom app. Database-bound data is the obvious trigger but you aren’t limited to DBs: changes to subelements of files, folders, and other data containers can also trigger cache refresh. You can set very finely grained conditions for these behaviors, refreshing and Not refreshing the cache as required by your app.

-KF


Leave a comment

(required)

(required)