NCache Live Upgrade

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.

  • Cache stays up. Applications keep reading and writing while servers are upgraded.
  • Data carries over. Cached data moves to the new version, so nothing has to be reloaded from the database.
  • Clients keep working. Through PATCH and MINOR upgrades, existing client applications run against upgraded servers without a recompile. A MAJOR upgrade needs them recompiled against the new client SDK, or swapped to the Forward Compatibility (FC) client (coming soon), which needs only a brief application restart.
 

Pick your upgrade method

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.

Choosing an upgrade method · 3 outcomes
Choosing an upgrade method . 3 outcomes
 

Version Compatibility Rules

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.

  • PATCH (5.3.801, 6.0.1, 6.0.2): bug fixes, security and dependency updates, new OS and runtime support that are backward compatible. Every PATCH is public and includes all earlier PATCH fixes. Released about 2-4 times a year.
  • MINOR (6.1, 6.2): new features, including new APIs, that are backward compatible. Includes all fixes since the last MINOR. Older clients work with new servers.
  • MAJOR (6.0, 7.0): new features and possible API changes or deprecated API removal. Clients must recompile against the new SDK. A new license key is needed.
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
 

Rolling upgrade for PATCH and MINOR versions

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.

  1. Take one server out of the cluster. Its partitions and replicas are covered by the remaining servers.
  2. Upgrade NCache on that server.
  3. Start it. It rejoins the running cluster and receives its share of data through state transfer.
  4. Wait for the configured delay (2 minutes by default), then move to the next server.

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.

Choosing an upgrade method · 3 outcomes
Rolling upgrade . 4 servers, 6.0.1 to 6.0.2
 

MAJOR version upgrades: two ways

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.

Choose an option

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

Prepare your client applications

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:

  • - Rebuild your client applications. Update the NCache client package to the new MAJOR version, recompile, and point the new builds' client.ncconf at the new-version servers.
  • - Or use the Forward Compatibility (FC) client (coming soon). Swap it in for the older client libraries, and rehearse the swap in a test environment first. See Forward Compatibility (FC) Client below.

Option A: Live upgrade through a Bridge

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:

  • Split the existing cluster. Take some servers out of the running cluster and upgrade them. No new hardware, but the Blue cluster runs with fewer servers until cutover.
  • Add new servers. Build Green on separate servers. Blue keeps full capacity, at the cost of temporary infrastructure.

    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.

Live MAJOR upgrade by splitting a 4-server cluster · 3 stages
Live MAJOR upgrade by splitting a 4-server cluster . 3 stages

Set up Green

  1. Free up servers. Tools: NCache Management Center. Stops one or more servers and removes them from Blue. The remaining servers keep serving clients. Skip this step if you are adding new servers.
  2. Upgrade them. Tools: NCache installer. Installs the new MAJOR version on the freed servers.
  3. Create the Green cache. Tools: Export-Configuration on Blue, New-Cache -Path on Green. Copies the Blue cache’s configuration and server-side modules, then creates and starts a cache with the same name and settings on Green.
  4. Sync Blue to Green through the Bridge

  5. Create the Bridge. Tools: NCache Management Center. Defines an Active-Passive Bridge with Blue as the active master and Green as passive, so data flows one way, from Blue to Green.
  6. Transfer the data. Tools: Start-Bridge, Start-BridgeStateTransfer. Starts the Bridge, then copies all existing data from Blue to Green. Both caches must be running first:
    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

  7. Move clients. Tools: client.ncconf or NCache Management Center. Points client applications at the Green servers. Deploy the recompiled applications, or restart applications updated with the FC client. Older client builds can't connect to the new MAJOR version.
  8. Drain and remove the Bridge. Tools: Bridge counters in NCache Management Center. Confirms the replication queue is empty, then stops the Bridge and removes Blue from it.

    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.

  9. Finish the old servers. Tools: NCache installer. Upgrades the remaining Blue servers and adds them to Green, restoring full capacity and high availability. If you added new servers instead, retire the old ones.

Option B: Export and import

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

  1. Export the configuration. Tools: Export-Configuration (Enterprise) or Export-CacheConfiguration (Open Source). Saves each cache’s configuration and its deployed server-side modules to a folder.
  2. Stop writes, then export the data. Tools: Export-CacheData. Backs up every item in the cache to files. For Pub/Sub caches, it also exports topics, durable subscriptions and messages.
  3. Restore on the new version

  4. Install the new MAJOR version. Tools: NCache installer. Installs it on the same servers or on new ones.
  5. Recreate the cache. Tools: New-Cache -Path. Creates the cache on the new version from the exported configuration.
  6. Restore the data. Tools: Import-CacheData. Loads the exported data into the new cache in bulk:
    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.

  7. Start the cache and reconnect clients. Deploy client applications recompiled against the new client SDK, or restart applications updated with the FC client.
 

Your client applications during an upgrade

Most upgrades need nothing from your application code. Upgrading the client package is still recommended, because newer clients carry bug fixes.

  • PATCH and MINOR: older clients keep working against upgraded servers. No recompile needed, and the older client libraries keep working.
  • MAJOR (option A or B): client applications must be recompiled against the new client SDK and deployed against the upgraded cluster. Code changes are needed only where you used deprecated APIs. With both options A and B, have the new builds ready before cutover. You can also use the Forward Compatibility (FC) client (coming soon), which needs no recompile, only a brief application restart. See below.

Upgrading a .NET client is a package update:

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.

Forward Compatibility (FC) Client for MAJOR

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.

 

Live upgrade in your environment

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.

Environment Level Upgrade: NCache.Deployment for Windows

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.

 

Environment Level Upgrade: Kubernetes Helm

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.

What to Do Next?

Frequently Asked Questions (FAQ)

No. Rolling upgrades and Bridge-based MAJOR upgrades keep the cache serving requests throughout. Only option B, export and import, needs a planned maintenance window.

Not for PATCH or MINOR upgrades. For a MAJOR upgrade, live or not, client applications must be recompiled against the new client SDK and deployed against the upgraded cluster. Code changes are needed only where you used deprecated APIs.

Yes, with the Forward Compatibility client (coming soon). You stop each application, replace its client libraries, update its config and restart it. The cache stays up the whole time. Prepare the swap in test so the production rollout is only a brief restart.

The Bridge keeps the cache and its data available across versions, so the cache never goes down. The client SDK still changes between MAJOR versions, so applications are rebuilt against it and redeployed when you move them to the new cluster.

Option A if the cache must stay up. Option B if a maintenance window is acceptable and you want fewer steps.

Not if your cluster has four or more servers. You can split it, upgrade half, and bridge the two halves. Smaller clusters need temporary servers, or option B.

Yes, with option B. With option A, you upgrade part of the cluster first, then the rest after cutover.

It's not in the export. Stop writes before exporting.

No. Servers on those versions can share a cluster, so a rolling upgrade carries data over automatically.

On Kubernetes, the Helm upgrade is all-or-nothing: every pod reverts to the current version. On Windows, the cluster keeps running on the remaining servers while you fix the failed one.

Cluster-to-cluster tools (Bridge, config export, data import) work with the previous MAJOR version only. To jump two MAJOR versions, upgrade one MAJOR version at a time.

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