Develop High-performance .NET Applications Effectively Under a Secured Environment
By Anand Narayanaswamy
Millions of people browse millions of Web sites every second. But it takes some time to get data from the server to the client when requests for Web pages are made. This will eventually slow down a Web server if a substantial amount of visitors browse the same site at the same time. Moreover, the performance of the Web site will be greatly affected if a large amount of data is being fetched from databases, such as Microsoft Access, SQL Server, etc. To a great extent, these difficulties can be reduced with the help of a technique called caching. Caching enables us to store Web pages and information on the client s computer so that it can be retrieved without much time spent at a later stage. This will not only increase the speed of the application, but it will also avoid round trips to the server each time a specific page is requested.
The built-in caching techniques provided by the .NET Framework are suitable for small-scale applications without much load. But if the size of your application becomes larger and requires fetching of a large amount of data from the database server, access to Web services, etc., then you need to think about increasing the performance of your application with the help of third-party components.
Enter NCache, a high-performance in-memory object caching solution for mission-critical .NET applications with real-time data access needs. Developed by AlachiSoft, NCache boosts the performance of .NET applications by not only caching read-only data, but also caching complex transactional data with relationships. The main purpose of NCache is to improve the performance of .NET applications by avoiding frequent access to database servers, Web services, and other systems across the network. The main benefit I noticed while working with this product is that it provides excellent scalable performance, transparent and complete failover, and failback protection.
Before downloading the product you must complete a simple registration process; the required product key will then be e-mailed to you. I downloaded the Clustered edition of the product within two minutes using a high-speed broadband connection. The installation process took another two minutes on a machine with 512 MB RAM.
One of the main features of this product is that it supports all three kinds of operations: read-through, write-through, and write-behind. NCache also automatically sends notifications asynchronously to the client applications throughout the cluster. It also handles object relationship through intelligent dependency management; for more details visit http://www.alachisoft.com/ncache/intelligent_cache.html.
NCache ships with a rich set of features, such as fixed-time and idle-time expiration of cached data, Least-Recently-Used (LRU), Least-Frequently-Used (LFU), priority-based eviction policies, and intelligent relationship management through file- and key-based dependencies. A main advantage of this product is that it ships with a common API for both local and clustered environments, which will certainly help you reduce the learning curve if you want to explore this product in detail.
The NCache API is the core part of the product, while NCache Service and NCache Manager Application provide the facility to create clusters and caches. These utilities are automatically installed at the time of setup. The API provides all the functionality to incorporate various user needs associated with caching. You can open the NCache Manager directly from the Start menu; see Figure 1 to see what it looks like.
Figure 1: Open the NCache Manager directly from the Start menu.
You must follow certain steps to get started with the product. First, create a new ASP.NET project and add reference to Alachisoft.NCache.Web. You need to import the Alachisoft.NCache.Web.Caching namespace into your application and inherit Alachisoft.NCache.Web.UI.NPage instead of System.Web.UI.Page. The next step is to initialize the cache in your Web application, as shown here:
You are now ready to use the cache in your application, and you can easily add, remove, and fetch the items from the cache. The product comes with a sample tutorial application that will explain the above scenario in detail. The product also ships with a utility called Keep Alive, which will automatically send an http request to the specified URL after the specific time interval. It also ensures that your application never times out by keeping the sessions active.
The product ships with sample applications, such as Chat and Guess Game, which you can explore from the Start menu. Unfortunately, I found that the vendor didn t implement validation rules for the sample applications. The application returned a run-time error when I tried to execute Guess Game without entering any data in the textbox. I hope the vendor will fix these issues during the next release of the product. I am pleased to report, however, that AlachiSoft provided excellent support for all the issues within one day of reporting the problems.
The product comes with complete source code and Visual Studio project files for all the sample applications. The product also ships with detailed documentation in HTML format, which you can also locate from the Start menu. The documentation provides comprehensive coverage about hardware and software requirements for working with the product, information about clusters, incorporating cache into your ASP.NET applications, and much more. It also provides help for the sample applications that ship with the product. I would like to see AlachiSoft integrate the documentation with Visual Studio.NET so that developers can easily access the help system while developing applications.
I would also like to see AlachiSoft provide support for the .NET Framework 2.0 in the next release of this product. NCache provides the necessary background for performing all the required tasks for the purpose of caching and it is up to you to effectively make use of it in your .NET applications.
NCache comes in two editions, Local and Clustered. The Local edition only supports local caches; the Clustered edition provides support for replicated and partitioned caches. A trial version of the product can be downloaded from the AlachiSoft Web site. It will be fully active for two full months; after that you can purchase the product directly from the vendor. The pricing of NCache is a little high, but you ll find real use of this product if you are developing large and critical .NET applications.
Anand Narayanaswamy, a Microsoft Most Valuable Professional (MVP), works as an independent consultant and runs NetAns Technologies (http://www.netans.com), which provides Web hosting services based in Trivandrum, India. NetAns is the winner of the Business Techguru contest conducted by Microsoft Small Business Centre. Anand also works as an editor for ASPAlliance. Find out more about him at http://www.visualanand.net or e-mail him at mailto:[email protected].
Web Site: http://www.alachisoft.com
Price: Local, US$995; Clustered, US$2,495