Setting Up Redis External Caching
  • 07 Jul 2022
  • 1 Minute to read
  • Dark
    Light

Setting Up Redis External Caching

  • Dark
    Light

Overview 

Prerequisites
  • Multiple instances of Decisions running on different machines and/or Virtual Machines (VMs) such as a clustered environment
  • A common database between all instances
  • An active Redis account with a Redis container
  • An Enterprise license. For further information on clustering and other Enterprise license features, contact support@decisions.com. 

To assist with scaling across multiple servers, external caching requires deploying a Redis server.

The Decisions servers and the Redis server communicate via a series of API calls to store and retrieve Objects.

While internal caching acts as a dictionary that clears old items when accessed, external caching supports more transactions between instances and from instance to database.


Connecting to the Redis Container

After meeting the other listed prerequisites, the following subsection explains how to create then customize the Redis server's connection settings i.e. port number and url.

The following example deploys a Redis container with Docker.

  1. On a device, run either the CMD or Windows Powershell as an Administrator. Enter the following command to create a Redis container. After running the command, the named Redis container along with its name and port number now appears when opening the Docker desktop application.
    docker run --name redis1 -p 6379:6379 -d redis

    The 'redis1' value may be replaced with a more descriptive name relevant to the content for external caching.

    By default, Redis servers operate with port number 6379 and utilizes the URL format {machineIP}:6379. For example, a Redis url for a local machine would be {localhost}:6379]. Users may change the Redis URL; however, this requires Decisions to restart for it to apply.
  2. Open the Decisions Studio and login to an account with access to System settings. Select the gear icon on the left taskbar then navigate to Settings > Clustering Settings.
  3. Enable Turn On Clustering and then enter the configured Redis URL from step 1. This example utilizes the default localhost Redis url.
    Avoid Using the Same Redis Container Between Multiple Clusters
    Each machine/node in a single cluster utilizes the same database, so setting the Redis URL in one node also sets it for all other machines/nodes within the cluster.

    However, do not use the same Redis container in different clustered environments. Each cluster should connect its own unique Redis container with its own unique Redis URL to prevent errors.

  4.  Restart the Decisions server via either the Installer window or through services.msc to confirm the connection.

Was this article helpful?