Using MongoDB for Caching .NET Web Pages
Peter Bromberg shares a MongoDB-based cache utility for .NET System.Web.Caching.Cache and some performance numbers:
The advantages of using such a MongoDb - based Cache are several-fold:
- It can be accessed from any machine on a network
- The cost is reasonable (as in “Free Beer”!)
- The cache survives IIS AppPool recycles and even machine reboots.
- Since it is designed to be able to implement the base OutputCacheProvider class (by just adding the required override keywords), it can be easily made to be a complete replacement for
System.Web.Caching.Cacheas described in the second article linked above.- MongoDB supports an automated sharding architecture, enabling horizontal scaling across multiple nodes. For applications that outgrow the resources of a single database server, MongoDB can convert to a sharded cluster, automatically managing failover and balancing of nodes, with few or no changes to the original application code.