Upgrade your NCache clusters to a newer version without taking the cache offline. PATCH and MINOR versions roll through the cluster one server at a time. MAJOR versions move over live through an NCache Bridge, or through a simple export and import when a maintenance window suits you better.
The size of the version jump decides the method. PATCH and MINOR upgrades are always rolling; MAJOR upgrades give you a choice.
| Upgrade type | Example | Method | Cache downtime | Extra servers | Cached data | Clients |
|---|---|---|---|---|---|---|
| PATCH | 6.0.1 → 6.0.2 | Rolling upgrade | None | No | Carried over automatically | Clients are live |
| MINOR | 6.0 → 6.1 | Rolling upgrade | None | No | Carried over automatically | Clients are live |
| MAJOR Option A | 5.3.8 → 6.0 | Live upgrade through a Bridge | None | Optional: split the existing cluster, or add servers | Kept in sync until cutover | Clients recompile and restart needed
Or use the FC client (coming soon): no recompile, just a brief application restart |
| MAJOR Option B | 5.3.8 → 6.0 | Offline upgrade through export and import | Planned maintenance window | Optional | Snapshot taken at export | Same as above |
PATCH and MINOR upgrades never need a Bridge, an export and import, or a client recompile. Both MAJOR options require client applications to be recompiled against the new client SDK and deployed against the upgraded cluster.
Starting with version 5.3.800, NCache follows the MAJOR.MINOR.PATCH versioning (based on the Semantic Versioning 2.0 standard), and each level has its own compatibility promise. That promise is what makes live upgrades possible.
| What works across versions | PATCH | MINOR | MAJOR |
|---|---|---|---|
| Older clients can connect to newer servers | Yes | Yes |
No Older clients must be recompiled against the new client SDK. Forward Compatibility (FC) Client No recompile needed. Swaps the client libraries. Update config, and restart the application. |
| Old and new servers in the same cluster | Yes | Yes | No |
| Newer management tools manage older servers | Yes | Yes | No |
| Newer Bridge servers and tools work with older caches | Yes | Yes | Previous MAJOR version |
| New-Cache -Path accepts an older exported config | Yes | Yes | Previous MAJOR version |
| Import-CacheData accepts older backed-up data | Yes | Yes | Previous MAJOR version |
A rolling upgrade replaces one server at a time while the rest of the cluster keeps serving clients. Servers on neighboring PATCH and MINOR versions can run in the same cluster, so the cluster never stops.
Cache auto-start is turned off on all caches for the duration of the upgrade. After each reboot, caches start one at a time, 2 minutes apart, so each one joins its cluster cleanly. Auto-start is turned back on once every server is upgraded.
Servers on different MAJOR versions can't form a cluster, so a MAJOR upgrade moves your caches to a cluster running the new version. Pick an option, prepare your client applications, then follow that option's steps.
Option A, live through a Bridge, keeps the cache up the whole time. Option B, export and import, needs a maintenance window but has fewer steps.
| A: Live through a Bridge | B: Export and import | |
|---|---|---|
| Cache downtime | None | Maintenance window |
| Extra servers | None if you split 4+ servers; otherwise temporary ones | None |
| Data | Kept in sync until cutover | Snapshot at export time |
| Steps | More: Bridge setup and cutover | Fewer |
| Rollback | Blue stays intact until retired; switch clients back | Reinstall the old version and import the export |
| Best for | Production caches that must stay up | Dev and test, or when a maintenance window is acceptable |
A MAJOR upgrade can be live on the server side, but not on the client side. Client applications must be recompiled against the new NCache client SDK and then deployed against the upgraded cache servers. Code changes are needed only where you used deprecated APIs or occasionally if some APIs change.
Do one of the following before the upgrade, for either option:
A live MAJOR upgrade works like a Blue-Green deployment. The old-version cluster (Blue) keeps serving clients while an Active-Passive NCache Bridge copies its data to the new-version cluster (Green). Once Green is in sync, you move clients over.
You can build the Green cluster in two ways:
Sizing. Each cluster needs at least two servers to stay highly available, so splitting needs four or more servers. With fewer, add temporary servers or use option B. While the cluster is split, each half carries the load with fewer servers: size it for peak traffic or upgrade during a quiet period.
Sync Blue to Green through the Bridge
Start-Bridge -Name demoBridge -Server 20.200.20.11
Start-BridgeStateTransfer -Server 20.200.20.11 -Name demoBridge `
-SourceCache demoCache.Blue -TargetCache demoCache.Green
Watch the state transfer per second counter in NCache Management Center. When it stops showing values, the initial transfer is complete. New updates on Blue keep flowing to Green through the Bridge.
Cut over and finish
Don't stop the Bridge early. Operations made on Blue during the transfer may still be queued. Stopping the Bridge before the queue is empty loses them.
Option B takes a snapshot of each cache's configuration and data, installs the new MAJOR version, and restores the snapshot. It needs a maintenance window but no Bridge, and it can reuse the same servers.
The export is a snapshot. Stop writes before exporting, or anything written afterward is lost.
Export from the current version
Restore on the new version
Import-CacheData -Name demoCache -Server 20.200.20.11 `
-Path C:\upgrade\data -Expiry Adjusted
-Expiry sets how restored items expire: Adjusted (default), AsBefore or None. Pub/Sub messages keep their original ID, creation time and expiry, so durable subscribers pick up where they left off.
Most upgrades need nothing from your application code. Upgrading the client package is still recommended, because newer clients carry bug fixes.
dotnet add package Alachisoft.NCache.SDK --version 6.0.2
For MAJOR upgrades, recompile the application and deploy again. For containers where your applications are images, you would need to rebuild those images and deploy.
Note: Coming soon
The FC client lets existing applications work with a new MAJOR version of NCache without being recompiled. It presents the older MAJOR version's API to your application but runs the new MAJOR version underneath.
On Windows, you install it over the older client libraries in the application's existing deployment. You stop the application, replace the libraries, update its config files, and restart it. No development work is needed. Run a quick sanity test afterward.
The cache stays up. Only each application restarts. The application is down only while its libraries are swapped. Do the swap in a test environment first so the updated application is ready. In production, it then rolls out right after the servers are upgraded, with only a brief restart per application.
| Environment | PATCH and MINOR | MAJOR |
|---|---|---|
| Windows servers | Update-NcEnvironment -Apply upgrade with upgrade.mode: rolling | Option A (Bridge) or Option B (Export and Import) |
| Kubernetes | helm upgrade --set image.upgrade=rolling | helm upgrade --set image.upgrade=offline (Option B, automated) |
| NCache Cloud (Azure / AWS) | Applied for you: PATCH and MINOR automatically in your maintenance window | MAJOR is fully automated on the server side but applied when you start it from the NCache Cloud Portal |
On Kubernetes, the offline mode backs up configuration and data, brings all pods down, upgrades them, and restores configuration and data:
helm upgrade ncache oci://registry-1.docker.io/alachisoft/ncache \
--set image.tag="6.0.0" \
--set image.upgrade="offline"
On NCache Cloud, the default maintenance window is the third Sunday of the month, 2:00 to 5:00 AM server time, and you can change it. OS security patches are applied in the same rolling way, one server at a time.
NOTE: Coming soon.
NCache.Deployment is a PowerShell module that helps you install and upgrade an entire environment consisting of multiple NCache servers and NCache clients. You can describe the environment once in YAML, then run a pre-flight check followed by the upgrade:
deployment:
servers: ["20.200.20.11", "20.200.20.12", "20.200.20.13", "20.200.20.14"]
installer:
path: "\\\\fileserver\\software\\ncache\\ncache-6.0.2.msi"
sha256: "<installer hash>"
upgrade:
mode: "rolling"
delayMinutes: 2
# Verify permissions and readiness on every server first
Update-NcEnvironment -Config .\production.yaml -Apply upgrade -Test
# Then upgrade one server at a time
Update-NcEnvironment -Config .\production.yaml -Apply upgrade
The installer is copied to each server's TEMP folder and checked against its SHA-256 hash before it runs. Use -Credential (Get-Credential) to run under a different identity.
One Kubernetes cluster could contain an entire environment with NCache servers as StatefulSet pods and optionally NCache clients. NCache published a Helm Chart to let you install and upgrade such an environment through a single command.
helm upgrade ncache oci://registry-1.docker.io/alachisoft/ncache \
--set image.tag="6.0.2" \
--set image.upgrade="rolling" \
--set image.delayMinutes=2
Pods are upgraded one at a time. The upgrade is all-or-nothing: if any pod fails to upgrade, every pod reverts to the current version, so the cluster is never left on mixed versions.
© Copyright Alachisoft 2002 - . All rights reserved. NCache is a registered trademark of Diyatech Corp.