Skip to content

Integrating Valkey

Valkey (formerly Redis) is an optional add-on for Node.js environments on the WordPress VIP Platform. The primary purpose of Valkey is to act as an in-memory datastore that is shared across application containers. Valkey is an open, Redis-compatible engine with improved throughput, memory efficiency, and scalability.

To enable Valkey for a Node.js environment, create a VIP Support request.

Connecting to Valkey

Once VIP Support has enabled Valkey, additional configurations are needed in order for the Node.js environment to interact with it.

Valkey environment variables that are defined by the VIP Platform:

  • VIP_REDIS_PRIMARY: The Valkey endpoint, represented by an IP address and port separated by a colon. Example: "127.0.0.1:1234".
  • VIP_REDIS_PASSWORD: The password required to connect (AUTH) to the Valkey endpoint. This value might be defined as an empty string.
  • A username is not required.

The ioredis package is a library commonly used for interacting with Valkey, and the following code example code shows how to use the VIP_REDIS_PRIMARY and VIP_REDIS_PASSWORD environment variables to form a connection string and create a Valkey client:

const Redis = require( 'ioredis' );
const endpoint = process.env.VIP_REDIS_PRIMARY;
const password = process.env.VIP_REDIS_PASSWORD;
const redisClient = new Redis( `redis://:${ password }@${ endpoint }` );

Alternatively, the VIP_REDIS_PRIMARY environment variable can be parsed to extract the host and port:

const Redis = require( 'ioredis' );
const [ host, port ] = process.env.VIP_REDIS_PRIMARY.split( ':' );
const password = process.env.VIP_REDIS_PASSWORD;
const redisClient = new Redis( { host, port, password } );

Caution

Valkey cannot be accessed from outside the VIP Platform or from a different VIP Platform environment. For example, the Valkey instance provisioned for one Node.js environment is not accessible from a different Node.js environment or from any WordPress environment.

Configuration

The Valkey operations EVALEVALSHA, and SCRIPT can cause severe performance issues and are disabled by default. If these operations are absolutely necessary, it is possible for them to be enabled by creating a VIP Support request. The default eviction strategy for stored keys is allkeys-lru.

Data ephemerality

Data stored in Valkey is not guaranteed to persist and Valkey should be considered an ephemeral cache store. Configuration or security updates are infrequent but can result in cold starts. Data stored in Valkey is not backed up and cannot not be restored to a previous state.

Therefore, do not design applications whose operation or performance depends on data being preloaded in Valkey. If an application’s performance could suffer during a Valkey cold start, consider writing and maintaining a script that populates the cache, and develop a strategy for running it against the application.

Error handling

Configure applications to catch connection errors and to fall back gracefully if Valkey is unavailable. Valkey is very reliable, but there may be brief moments when it is unavailable if configuration or security updates are performed by VIP.

Last updated: January 13, 2026

Relevant to

  • Node.js