4 min readUpdated Mar 2, 2026

redis.adapter Integration Documentation

Overview

The redis.adapter is an integration for connecting to Redis, an in-memory data structure store commonly used for caching and data storage. This adapter facilitates communication with Redis through both read and write commands, enabling the utilization of Redis for data storage, retrieval, and manipulation within the Vantage analytics platform.

Purpose

The primary purpose of the redis.adapter is to allow applications to connect to a Redis instance, perform data operations (read and write), and facilitate a seamless integration with Redis features such as key management, data types (strings, hashes, lists, sets, sorted sets), and data retrieval operations.

Settings

The redis.adapter takes various settings to establish a connection with Redis. Below is a detailed explanation of each setting:

1. host

2. port

3. username

4. password

5. ssl

How It Works

  1. Client Initialization: When the adapter is instantiated, the RedisAdapter class attempts to create a Redis client using the provided settings (host, port, username, password, and SSL).
  2. Connection Handling: The _getClient method ensures a connection is established to the Redis server. It utilizes the Redis client library to create the client based on the connection parameters supplied.
  3. Executing Commands: The adapter provides methods for both read (executeReadOnly) and write (executeWrite) operations. Each method validates the commands against predefined lists of allowed commands before attempting to execute them.
  4. Close Connection: The close method cleans up by closing the connection to the Redis server when it is no longer needed.

Data Expectations

The redis.adapter expects data in the form of key-value pairs, supported by various Redis data types. Specific commands can accept a range of arguments:

Use Cases & Examples

Use Cases

  1. Caching Frequently Accessed Data: A web application can leverage Redis as a caching layer to speed up data retrieval and reduce load on primary databases.
  2. Session Management: Redis can be used to store user sessions in a web application, improving response time and scalability.
  3. Real-time Analytics: Utilize Redis for storing temporary data during analyses, enabling swift calculations and aggregations.

Example Configuration

Use Case: Caching Frequently Accessed Data in an E-commerce Application

To configure the redis.adapter for caching product details, the connection might look like the following:

json
{
    "host": "redis-cache.example.com",
    "port": 6379,
    "username": "cacheUser",
    "password": "securepassword123",
    "ssl": true
}

Sample Usage: To cache a product detail after retrieving it from a primary database, you could use:

javascript
await redisAdapter.executeWrite({
    command: 'set',
    args: ['product:12345', JSON.stringify(productDetails)]
});

// To retrieve the product detail later:
const productDetail = await redisAdapter.executeReadOnly({
    command: 'get',
    args: ['product:12345']
});

AI Integrations and Billing Impacts

Currently, the redis.adapter does not incorporate any specific AI integrations within its functionality. However, it can be a critical component in setups that involve machine learning workflows by analyzing cached data or session data trends.

Regarding billing impacts, using this integration to cache data can substantially reduce the operational load and query costs on a primary database. Users should be aware of potential costs associated with Redis instances (if cloud-hosted) but may observe savings from decreased database queries. Always review service provider documentation for precise pricing details based on usage strategies.