Redis to NCache Migration
NCache provides a Redis wrapper for .NET applications that use the StackExchange.Redis client library. The wrapper acts as a compatibility layer between StackExchange.Redis application code and NCache, allowing applications written against Redis-style interfaces to migrate from Redis to NCache with minimal code changes. With this wrapper, applications can continue using familiar Redis-based code and operation patterns while using NCache as the distributed cache backend. This lets you retain your existing StackExchange.Redis application flow and benefit from NCache features.
How the NCache Redis Wrapper Works
The NCache Redis wrapper follows the same programming model used by StackExchange.Redis. Existing applications can continue working with familiar StackExchange.Redis objects such as ConnectionMultiplexer, IDatabase, and ISubscriber, while the actual cache operations are performed against NCache.
ConnectionMultiplexer remains the main entry point for the application. In a Redis application, it connects to a Redis server endpoint. With the NCache wrapper, it connects to an NCache cache by cache name and manages the underlying NCache connection. After the connection is created, the application uses GetDatabase() to access cache data operations. This database object handles supported Redis-style operations and maps them to the corresponding NCache behavior.
For Pub/Sub, the application uses GetSubscriber() instead of the database object. This follows the StackExchange.Redis design, where messaging operations are separate from regular cache data operations. In the NCache wrapper, publish, subscribe, and unsubscribe operations are handled through NCache messaging.
In this way, the wrapper acts as a compatibility layer between StackExchange.Redis application code and NCache. The application keeps the Redis client programming model, while NCache serves as the distributed cache backend.
Note
This feature is also available in NCache OpenSource, except for data structure operations (Hash, List, Set) and Object-to-Byte-Array serialization.
In This Section
Migrate Redis Applications to NCache
Explains the basic steps required to migrate from an existing StackExchange.Redis application to NCache.