CloserLook
NCache Enterprise 3.6
Boost the performance of ASP.NET applications
By Anand Narayanaswamy
NCache Enterprise 3.6
Rating: 4 out of 5 stars
Website: www.alachisoft.com
Price: Free $13,495, depending on version; see www.alachisoft.com/buy.html.
Boosting the performance of an ASP.NET applicationis a challenging task for every developer. Although the built-in tools providedwith .NET Framework are sufficient for small-scale projects, large applicationsdemand a dedicated product like NCache, which can significantly enhance thespeed of .NET applications by employing simple techniques programmatically.Developed by California-based AlachiSoft (www.alachisoft.com), the productunleashes a new era among distributed caching mechanisms by taking care of bothstatic and transactional application data, thereby reducing round trips betweendatabase servers.
The product supports a wide range of cachingtopologies such as local, replicated, client, mirrored, partitioned andpartition-replica caches and it can store unlimited caches. Of the product'sthree editions (express, professional and enterprise), only the enterpriseedition supports all the above-mentioned caches. With the help of sophisticatedbridge topology, mainly used for disaster recovery without compromisingpotential latency issues, the enterprise edition supports caches across a WideArea Network (WAN). NCache also provides support for dynamic clustering throughInProc and OutProc mechanisms. While the former resides inside your applicationprocess, the latter sits in its own process and enables multiple applicationsto access the same cache.
NCache provides a dynamic thin client for gridcomputing and high-performance computing applications. An interesting featureis that you can use the client without any installation and you can dynamicallyload or unload the client on relevant grid nodes. In addition, you canreplicate sessions in your .NET 2.0 and 3.5 applications by using Session StateProvider rather than HttpModule, as in a previous version of NCache (http://www.aspnetpro.com/productreviews/2006/02/asp200602an_p/asp200602an_p.asp).
Share Sessions Easily
With NCache you can share sessions across multiplelocations easily without session loss and without compromising speed. Thismeans that if you hosted a web application in Trivandrum, London and New York,your users can switch between each location without any session loss. NCache shipswith a cluster connectivity dialog that shows the nodes of a specified clusterand includes support for Enterprise Library 4.1, NHibernate 2.0 and MicrosoftVelocity. The vendor also provides a set of PowerShell scripts that you can useto administer the product. Moreover, the product uses IP addresses instead ofnode names for establishing connectivity.
When you use NCache to enhance the quality of anapplication, you need to delete items cached over a specified period of time. Forthis purpose you can use two kinds of data expirations: Absolute Time and IdleTime. While the former indicates that caches should be deleted at a set time,the latter provides an option to delete a cache after it has not been accessedfor a certain amount of time. NCache supports three levels of dependencies File,Key and Multi-cache and the enterprise edition lets you implement cachesynchronization with a wide range of databases (e.g., SQL Server 2005, SQLServer 2008 and Oracle 10g R2). I would like to see AlachiSoft provide supportfor MySQL in the product's next release.
Code-based products such as NCache should include utilitiesfor performing tasks easily and NCache is no exception. The product comes witha manager utility that you can use to create, start, stop and maintain cacheswithout using DOS-based commands. However, you can also use command-line toolslocated under the product installation folder of the Start menu.
Working with NCache
To work with NCache, you need to importthe Alachisoft.NCache.Web.Caching namespace into an application and insert thecache item by using the relevant object name and read/write options (Figure 1).

Figure 1:NCache Manager with wizard in action
An interesting aspect of the product isthat it lets you monitor caches by using a GUI utility named NCache Monitor orby using WMI-based remote cluster monitoring.
The product supports tags, which you can use to attachone or more keywords to cache objects. The enterprise edition includes built-insupport for Async and bulk operations. It also ships with features such asRead-Through, Write-Through, Write-Behind handlers, Object Query Language (OQL)and Data Groups. A key feature of the product is the introduction of compactserialization, which is an alternative for .NET serialization included with the.NET Framework. However, you can employ both types, depending on the project's requirements.NCache uses managed .NET memory, but you need to manually provide theinstruction at the time of cache creation. The product also allows a clientapplication to open connections to multiple caches.
AlachiSoft provides several sample applications andextensive documentation, which should help you quickly learn how to use NCache.The documentation contains some errors, which I hope will be resolved in thenext release. While the product lets developers build highly scalable ASP.NETapplications, end users will surely benefit from the speed at which client andserver interact with each other, thereby reducing the time spent completing anassigned task.
Anand Narayanaswamy(visualanand@gmail.com) is a Microsoft MVP. He works as an independentconsultant based in Trivandrum, India.