Cookie Consent by Free Privacy Policy Generator Live Upgrades in NCache with 100% Uptime

Live Upgrades in NCache with 100% Uptime

NCache is an extremely fast and scalable in-memory distributed cache for .NET applications. It is mostly used in read-intensive mission-critical production environments. In such applications, high availability and 100% uptime are critical, making NCache a necessity.

One of the key features NCache offers for such environments is Live Upgrade, which lets you upgrade to a newer version without any downtime. NCache Live Upgrade is a zero-downtime migration mechanism designed to maintain 100% availability during version transitions. By leveraging an Active-Passive Bridge topology, it synchronizes data in real-time between different NCache versions, allowing for a seamless transition without data loss or application interruption.

How Does Live Upgrade of a Cache Cluster Work?

Live Upgrade significantly reduces the delays typically associated with manual server upgrades. It allows you to upgrade all the servers of a cache cluster with minimum lag. Since NCache, by design, requires all servers to be running the same version of NCache, this prevents any version incompatibility issues.

To keep your cluster version up-to-date, NCache offers a Bridge topology for WAN replication that acts as a bridge between two cache clusters. In this way, you can incrementally replicate the data of your currently running cache to the latest NCache cache using that bridge in between while the caches continue to run.

This Live Upgrade process functions similarly to a Blue-Green Deployment strategy. Your 'Source' cluster acts as the "Blue" environment, while the 'Target' cluster acts as the "Green" environment, with the Bridge ensuring data parity and seamless synchronization before the final cutover.

NCache Live Upgrade diagram Blue-Green migration showing data sync from Source to Target cluster via Bridge topology
NCache Zero-Downtime Live Upgrade and Blue-Green Migration Workflow.

Follow the steps provided here to upgrade your cluster's caches through Live Upgrade.

Step 1: Isolating a Server Subset for Software Upgrades

In your cluster, if you have 2 or more cache servers, take a subset of them out to upgrade the NCache server software on those servers.

When taking a subset out, it's better to have a total of 4 or more cache servers, so at least 2 servers are left in the source cluster. However, in these cases, your application may experience downtime if the only server supporting it goes down.

Step 2: Cluster Initialization for Newer NCache Versions

After you have upgraded NCache on 2 or more cache servers, create a cluster of them all and start the cache on these servers. You must have at least 2 servers in each sub-cluster to ensure high availability - if there is just one server and it goes down, you might experience downtime.

Step 3: Synchronizing Data via Active-Passive Bridge Topology

After you have successfully created a cluster comprising all cache servers running a newer version of NCache, create a Bridge between the new cluster (commonly known as the target cache) and the older version cluster (source cache).

To create this Bridge, you can either use two dedicated servers with the older version of NCache or run a Bridge topology on two of the servers with a running older version of NCache. Use an active-passive configuration of the Bridge topology and wait until the target cluster is completely in sync with the source cluster.

On the Bridge node, you need to add the IPs of the target cache to populate the Bridge servers. You can do so through bridge.ncconf as follows:

<configuration>
  <bridge-config ... >
      <cache ... servers-list="20.200.20.38, 20.200.20.29" ... />
   </bridge-config>
</configuration>

Step 4: Phased Client Migration to the Target Cluster

After both clusters have fully synchronized, you need to take a subset of the clients and migrate it all to the new version cache cluster. Once they have been migrated, you need to immediately stop all clients connected to the old versions. This cache client migration through an active-passive Bridge ensures that there is no data loss and no interruption in the client application operations.

Step 5: Finalizing the Upgrade for Remaining Nodes

After client connections have successfully been transferred to the target cluster, the source cluster needs to be stopped and upgraded. Once upgraded, these nodes are rejoined to the target cluster, restoring full high-availability and increasing the total compute capacity of the new version environment.

That should be your last step in using the Live Upgrade feature of NCache to upgrade your existing cache cluster.

Step 6: Migrate all cache clients to the new cluster

Now you need to migrate the remaining clients connected to the old version to the new version cache cluster. After all your clients have been successfully migrated, you can start running your application on them.

Use Old Clients with New Cache Cluster

In case you don't want to upgrade your cache clients, NCache allows older version clients to seamlessly work with a newer version cache cluster. So, it's up to you whether you want to upgrade your clients or keep the older version NCache clients on your application servers or web servers (NCache remote clients). Your application will run perfectly even if all your cache servers have been upgraded to the newer version. This is all possible because NCache provides backward compatibility for clients.

Use New Cache Client with Backward Compatibility API

It is recommended to upgrade the NCache client software on your application and web servers because the newer client might come packed with any requested bug fixes. This process is extremely easy and seamless. That's because the newer version of the client is backward compatible with the older version. This compatibility lets your application to work with the newer client without noticing any change whatsoever. The best part about using Live Upgrades in your application is that it doesn't require any code change or recompilation. You just need to upgrade the version of the NCache client software, and the rest is done for you automatically.

To get detailed step-by-step instructions on how to use the Live Upgrade feature to upgrade your NCache cluster, follow our documentation on Live Upgrade NCache Version.

What to Do Next?

Frequently Asked Questions (FAQ)

NCache achieves 100% uptime by utilizing a temporary Active-Passive Bridge topology. This acts as a synchronization layer that replicates data in real-time from the "Source" (old version) to the "Target" (new version) cluster while both continue to run.

No, it does not require any code change or recompilation. This is possible because NCache provides backward compatibility for clients, allowing your application to work seamlessly with newer server versions without noticing any change.

Yes, you can keep older version NCache clients on your application or web servers. NCache's built-in backward compatibility ensures that your application will run perfectly even if all your cache servers have been upgraded to the latest version.

The Bridge serves as the critical data-transfer link between two separate clusters. It allows you to incrementally migrate data and client connections from the old "Blue" environment to the new "Green" environment without data loss or interruption.

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