Intro to NCache

NCache is an open source in-memory distributed cache for both .NET and Java based applications. NCache helps you in achieving extremely fast transactional speeds for your mission-critical apps with ease of linear scalability.

Distributed In-Memory Datastore

NCache is an extremely fast and scalable open source datastore because of its in-memory nature and distributed architecture. It is the only 100% .NET / .NET Core solution in the market as other solutions are C++ and Linux based, making it fit in very nicely to your applications’ .NET stack. It is the favorite caching solution in .NET developers’ community, making it a .NET market leader for the last 15 years.

Which .NET Applications Need NCache?

You’ll most likely benefit by using NCache if your application belongs to one of the following categories:

  • Web Applications (ASP.NET/ASP.NET Core)
  • Web Services Applications (.NET)
  • Micro-services Applications (.NET)
  • Other Server Applications (.NET)

Why Do You Need NCache?

Handling Extreme Transaction Loads: Your application needs to process extreme amounts of transactions during peak times. NCache lets you handle all that transactional load without any downtime.

Customer Facing Websites: Retail businesses doing most of the transactions mainly through customer facing website or an online store or a purely e-commerce business selling your products online, can rely on NCache for high availability. Likewise, NCache can benefit leading airlines selling tickets and reservations from the website or an online gaming or betting website in Europe where customers log in during major sporting events to place bets in real time.

Background Processing Businesses: A business that needs to process a lot of transactions in the background such as banks processing customer wires or a credit card company monitoring your customer transactions to do fraud detection. Similarly, a logistics business, monitoring a lot of vehicles in real time or a utility company monitoring a lot of devices in real time and analyzing their behavior can use NCache to ensure fail-safe data caching.

If you're one of these businesses or a host of other similar businesses then you cannot afford to have your application slowed down during peak times because the cost to your business is very high. Unfortunately, many applications do slow down because the database cannot cope with such high transaction loads and becomes a bottleneck. Reason being unlike the application tier where you can add more servers as your transaction load grows, you cannot add more servers to your database tier.

NCache - The Solution

The solution to this problem is to use NCache to cache application data and to also store all transient or temporary data in it. Unlike your database, NCache is distributed and allows you to build a caching tier of two or more servers and pools the memory and CPU of all the cache servers into one logical capacity. NCache then lets you add more servers to this caching tier as your transaction load grows.

NCache

As a result, NCache can scale linearly and it never becomes a performance bottleneck. On top of this, since NCache is totally in-memory, it is super-fast. You can use NCache in three different ways.

  1. You can cache application data in NCache to reduce your database trips by 80 to 90% making sure your database is no longer a performance bottleneck.
  2. You can store your ASP.NET/ASP.NET Core Sessions in NCache because it is extremely fast and scalable and also because it replicates sessions across multiple servers for high availability
  3. You can use NCache as a simple yet powerful Pub/Sub Messaging and Events platform and coordinate work among multiple server applications seamlessly.

Feature Highlights

Let's have a quick look at the features that NCache offers to ensure linear scalability by removing performance bottlenecks.

Feature: Keep Cache Fresh

NCache has a number of ways to help you keep your cache data as fresh as possible without your application having to keep track of all this. You can use Absolute and Sliding expirations to automatically remove data from the cache.

Feature: SQL Searching

You can also have NCache automatically sync itself with SQL database if data is changed in the database by other applications. You can also specify one to many and one to one relationships of data in the cache so data integrity is not violated when the cache is updated.

If you're putting a lot of data in the cache then NCache lets you search for it based on object attributes, groups, tags, and named tags. This makes it really easy to find your data. You can use SQL or LINQ queries for searching the cache and NCache also creates indices to speed up your searches.

Feature: Server-Side Code

NCache is the only solution in the .NET space to give you server-side code capability. You can implement Read-Thru to let your cache fetch the data from your database and when you combine this with Auto-Load feature, NCache automatically reloads data upon explorations or upon database synchronization. You can also implement Write-Thru to let the cache update your database for you.

Write-behind updates the database asynchronously so your application doesn’t have to wait for it. Finally, a Cache Loader automatically pre-loads the cache when you start it.

Feature: Client Cache (InProc Speed)

NCache is the only solution in .NET to provide a client cache feature also called a “Near Cache”. It gives you an InProc performance as if the cache data is kept within your application process. Client cache is a local cache to your application but stays synchronized with the caching tier for all updates by other applications or other users. Client cache gives your application a significant performance boost.

InProc Speed

Feature: WAN Replication of Cache

If your application is deployed to multiple data centers, multiple Azure regions or multiple AWS availability zones, then NCache lets you replicate the cache across the WAN without slowing down your application in either location. You can deploy NCache in an Active-Passive or an Active-Active data center configuration.

Active-Passive
Active-Passive
Active-Active
Active-Active

Deployment Options

.NET Framework Support

As you already know, NCache is 100% .NET / .NET Core solution let's see what kind of .NET support does it have and let's also see different ways you can deploy NCache. NCache provides a cache client with full support from both .NET Framework with things like:

  • Entity Framework 6.x
  • NHibernate Cache
  • ASP.NET Session
  • View State
  • Output Cache
  • ASP.NET SignalR

.NET Core Support

For .NET Core, NCache suppots:

  • EF Core Cache
  • ASP.NET Core Session
  • Response Cache
  • IDistributedCache
  • ASP.NET Core SignalR

NCache Server (100% .NET)

Just like the cache client, NCache server is also 100% .NET / .NET Core. No other solution has this as others are C++ or Linux. NCache server supports both .NET and .NET Core and through the .NET core Edition, you can deploy NCache in the below-given capacities:

  • Windows Server/Nano Server/Linux
  • On-Premises installation on Windows and Linux
  • As a VM in Azure and AWS cloud through their marketplaces
  • As a managed Cache Cloud Service Clister in Azure and AWS through NCache’s own Cloud Portal
  • Download a docker image of NCache from docker hub
  • Create your own customer docker image of NCache through docker files

What to Do Next?

© Copyright Alachisoft 2002 - . All rights reserved. NCache is a registered trademark of Diyatech Corp.