Changing AppFabric With NCache


What’s AppFabric?

Microsoft’s AppFabric for Home windows Server is middleware consisting of two important options, AppFabric Internet hosting deploy and handle Home windows Workflow Basis (WF), workflows which are hosted in Home windows Communication Basis (WCF) companies. Moreover, it accommodates an extension for IIS that permits efficiency and workflow monitoring together with PowerShell instructions to handle persistence, internet hosting, and monitoring duties.

AppFabric caching, the second important characteristic, is an in-memory, distributed cache that runs on a number of on-premises servers to supply a efficiency and scalability enhance for .NET Framework functions.

AppFabric caches saved knowledge in key-value pairs utilizing the bodily reminiscence throughout a number of servers.

AppFabric Lifecycle

AppFabric makes use of Microsoft’s mounted lifecycle coverage, which signifies that mainstream assist for AppFabric 1.1 ended on April 11, 2017. Prolonged assist lasts till April 12, 2022. Microsoft has added one further notice:

AppFabric 1.1 for Home windows Server assist ends on the date indicated except distributed as a element of SharePoint Server 2013, 2016, and 2019. Parts obtain the identical assist as their mum or dad product or platform.

To exchange AppFabric, Microsoft has created a migration information, detailing which merchandise Microsoft recommends utilizing. This primarily consists of the utilization of NCache or Redis Cache companies. Please click on right here to learn extra about it. 

What’s NCache?

NCache is an Open Supply in-memory distributed cache for .NET, Java, and Node.js. NCache is extraordinarily quick and linearly scalable and caches utility knowledge to scale back costly database journeys. Use NCache to take away efficiency bottlenecks associated to your knowledge storage and databases and scale your .NET, Java, and Node.js functions to excessive transaction processing (XTP).

On this article, I’m going to elucidate how you can Use NCache as AppFabric various. 

Set up NCache Supervisor

Obtain NCache from NCache Obtain Middle ( I extremely suggest you to put in the Enterprises version as a way to discover all of the options. Earlier than the set up be certain .NET 6 has been put in in your machine. 

After finishing the obtain and set up course of, you’ll be able to run the NCache Net Manger within the bowser from localhost 8251 port, as proven within the beneath determine.

We will create a clustered and native caches from the NCache Supervisor utility.

For this demo, I’ve created a neighborhood cache and named it “myLocalCache” utilizing Ncache Supervisor as proven within the beneath determine.

Click on right here to verify how you can create a neighborhood Cache utilizing NCahce Net Supervisor.

Let’s do the stress check to verify our cache standing. Run beneath command in command immediate to begin the stress check 

“test-stress <Cache Identify>”

Now the stress check has been accomplished, verify the rely from cache statistics. You’ll be able to go to Cache statistics by deciding on our cache from NCache Net Supervisor and clicking on the statistics icon. 


The best way to Use NCache as AppFabric various? 

There are some particular the reason why NCache is used as a greater various for AppFabric. As a result of it’s 100% native .NET and runs on home windows platform, the oldest and extra steady .NET distributed cache with totally supported official .NET and Java Purchasers and is way more highly effective. 

We’ve two choices emigrate AppFabric to NCache 

  1. Utilizing AppFabric wrapper 
  2. Making Direct NCache API Calls 

Utilizing AppFabric wrapper

No code adjustments are required whereas utilizing AppFabric wrapper, simply by putting in the wrapper package deal and changing the Namespace will do the job to go. 

Making Direct NCache API Calls

It requires code adjustments however no logic adjustments are required and it is extra highly effective with NCache options.

Notice: We will use AppFabric Wrapper and NCache API’s can be utilized aspect by aspect. 

Utilizing AppFabric Wrapper 

Simply observe three easy steps emigrate from AppFabric to NCache

  1. Obtain and Add NCache SDK package deal from Nuget Package deal Supervisor
  2. Obtain and Add NCache Wrapper Nuget Package deal 
  3. Exchange AppFabric Namespace with NCahce Wrapper 

1. Add NCache Nuget Package deal

Open your current AppFabric challenge in your visible studio and Set up Alachisoft.NCache.SDK package deal from NuGet package deal supervisor. 

2. Obtain NCache Wrapper for AppFabric 

Set up AppFabric.Wrapper.NCache NuGet in your utility. After putting in the Nuget package deal in your AppFabric utility, consumer.ncconf and config.ncconf information shall be included in your challenge.

3. Exchange AppFabric Namespace with NCahce Wrapper 

Make the next adjustments in your utility .csproj and .cs information.

Take away the references to the next AppFabric libraries,

  • Microsoft.ApplicationServer.Caching

Exchange the next namespaces with Alachisoft.NCache.Information.Caching within the utilizing statements of your supply information,

  • Microsoft.ApplicationServer.Caching
  • Microsoft.ApplicationServer.Caching.Shopper
  • Microsoft.ApplicationServer.Caching.Core

After finishing all of the steps, you need to use different extension strategies from NCache library. 

Now you must be capable of run your AppFabric utility utilizing NCache because the distributed caching resolution. 

For reference please verify this challenge supply from GitHub


We noticed what’s NCache, how it may be a greater various for AppFabric and the way it is extremely emigrate the AppFabric app to NCache because the distributed caching resolution. We’ll see extra about NCache in my future articles 

Pleased Coding!!!

Show More

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button