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 application is a challenging task for every developer. Although the built-in tools provided with .NET Framework are sufficient for small-scale projects, large applications demand a dedicated product like NCache, which can significantly enhance the speed of .NET applications by employing simple techniques programmatically. Developed by California-based AlachiSoft (www.alachisoft.com), the product unleashes a new era among distributed caching mechanisms by taking care of both static and transactional application data, thereby reducing round trips between database servers.
The product supports a wide range of caching topologies such as local, replicated, client, mirrored, partitioned and partition-replica caches and it can store unlimited caches. Of the product's three editions (express, professional and enterprise), only the enterprise edition supports all the above-mentioned caches. With the help of sophisticated bridge topology, mainly used for disaster recovery without compromising potential latency issues, the enterprise edition supports caches across a Wide Area Network (WAN). NCache also provides support for dynamic clustering through InProc and OutProc mechanisms. While the former resides inside your application process, the latter sits in its own process and enables multiple applications to access the same cache.
NCache provides a dynamic thin client for grid computing and high-performance computing applications. An interesting feature is that you can use the client without any installation and you can dynamically load or unload the client on relevant grid nodes. In addition, you can replicate sessions in your .NET 2.0 and 3.5 applications by using Session State Provider 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 multiple locations easily without session loss and without compromising speed. This means 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 ships with a cluster connectivity dialog that shows the nodes of a specified cluster and includes support for Enterprise Library 4.1, NHibernate 2.0 and Microsoft Velocity. The vendor also provides a set of PowerShell scripts that you can use to administer the product. Moreover, the product uses IP addresses instead of node names for establishing connectivity.
When you use NCache to enhance the quality of an application, you need to delete items cached over a specified period of time. For this purpose you can use two kinds of data expirations: Absolute Time and Idle Time. 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 accessed for a certain amount of time. NCache supports three levels of dependencies File, Key and Multi-cache and the enterprise edition lets you implement cache synchronization with a wide range of databases (e.g., SQL Server 2005, SQL Server 2008 and Oracle 10g R2). I would like to see AlachiSoft provide support for MySQL in the product's next release.
Code-based products such as NCache should include utilities for performing tasks easily and NCache is no exception. The product comes with a manager utility that you can use to create, start, stop and maintain caches without using DOS-based commands. However, you can also use command-line tools located under the product installation folder of the Start menu.
Working with NCache
To work with NCache, you need to import the Alachisoft.NCache.Web.Caching namespace into an application and insert the cache 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 is that it lets you monitor caches by using a GUI utility named NCache Monitor or by using WMI-based remote cluster monitoring.
The product supports tags, which you can use to attach one or more keywords to cache objects. The enterprise edition includes built-in support for Async and bulk operations. It also ships with features such as Read-Through, Write-Through, Write-Behind handlers, Object Query Language (OQL) and Data Groups. A key feature of the product is the introduction of compact serialization, 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 the instruction at the time of cache creation. The product also allows a client application to open connections to multiple caches.
AlachiSoft provides several sample applications and extensive documentation, which should help you quickly learn how to use NCache. The documentation contains some errors, which I hope will be resolved in the next release. While the product lets developers build highly scalable ASP.NET applications, end users will surely benefit from the speed at which client and server interact with each other, thereby reducing the time spent completing an assigned task.
Anand Narayanaswamy ([email protected]) is a Microsoft MVP. He works as an independent consultant based in Trivandrum, India.