Try Playground
Show / Hide Table of Contents

Redis Alternatives: Redis to NCache Migration

To seamlessly migrate from your already existing StackExchange.Redis client application, NCache being a redis alternative provides a wrapper with the ease of minimal code and logic change along with its features. Follow the steps below to learn how to migrate from Redis to NCache using the NCache wrapper for StackExchange.Redis.

Step 1: Download NCache Redis Alternative Wrapper NuGet Package

NCache provides the wrapper for StackExchange.Redis as a NuGet package. To install NuGet package in your application, open Visual Studio, go to Tools -> NuGet Package Manager -> Package Manager Console. On the console window, type and execute the following command:

Install-Package StackExchange.Redis.Wrapper.NCache

Step 2: Add the Namespace to your Application

Next, replace the StackExchange.Redis namespace with NCache.StackExchange.Redis in your application, as shown below:

using NCache.StackExchange.Redis

Step 3: Connection with NCache

Note

Ensure your cache is running.

  • Replace the Server IP with the name of your cache that you have created in the App.config file.
<configuration>
    <appSettings>
        <add key="CacheId" value="demoCache"/>
    </appSettings>
</configuration>
  • Now, you need to connect with your cache using the ConnectionMultiplexer class, which is the central object in the StackExchange.Redis API, as shown below:
ConnectionMultiplexer ncache = ConnectionMultiplexer.Connect("demoCache");
  • Next, to get an instance of the NCache cache store, write the following line:
IDatabase db = ncache.GetDatabase();

After completing these steps, you will be able to connect your StackExchange.Redis application to the NCache, one of the best Redis alternatives, cache and execute different caching operations.

Additional Resources

NCache provides code for StackExchange.Redis wrapper library and sample application on GitHub.

See Also

.NET: Alachisoft.NCache.Client namespace.
Java: com.alachisoft.ncache.client namespace.
Node.js: Cache class.
Python: ncache.client class.

In This Article
  • Step 1: Download NCache Redis Alternative Wrapper NuGet Package
  • Step 2: Add the Namespace to your Application
  • Step 3: Connection with NCache
  • Additional Resources
  • See Also

Contact Us

PHONE

+1 (214) 764-6933   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • NCache Enterprise
  • NCache Professional
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Download
Pricing
Try Playground

Deployments
  • Cloud (SaaS & Software)
  • On-Premises
  • Kubernetes
  • Docker
Technical Use Cases
  • ASP.NET Sessions
  • ASP.NET Core Sessions
  • Pub/Sub Messaging
  • Real-Time ASP.NET SignalR
  • Internet of Things (IoT)
  • NoSQL Database
  • Stream Processing
  • Microservices
Resources
  • Magazine Articles
  • Third-Party Articles
  • Articles
  • Videos
  • Whitepapers
  • Shows
  • Talks
  • Blogs
  • Docs
Customer Case Studies
  • Testimonials
  • Customers
Support
  • Schedule a Demo
  • Forum (Google Groups)
  • Tips
Company
  • Leadership
  • Partners
  • News
  • Events
  • Careers
Contact Us

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Contact Us
  •  
  • Sitemap
  •  
  • Terms of Use
  •  
  • Privacy Policy
© Copyright Alachisoft 2002 - 2025. All rights reserved. NCache is a registered trademark of Diyatech Corp.
Back to top