How to use IBM App Connect with Redis

Redis (REmote DIctionary Server) is an open source data store, which holds data in memory and functions as a database, cache, and message broker.

As a NoSQL database, Redis stores key/value pairs in data structures (such as string, hash, and list data types) rather than within tables and other database objects, which are used by SQL-based relational databases. Redis also provides a set of commands that can be used to execute operations on the Redis server (for example, SET and GET) in much the same way as SQL-based statements such as INSERT or SELECT.

Availability:
  • A connector in IBM App Connect Enterprise as a ServiceApp Connect Enterprise as a Service connector
  • A local connector in a Designer instance of IBM App Connect in containers (Continuous Delivery release)Local connector in containers (Continuous Delivery release)
  • A local connector in a Designer instance of IBM App Connect in containers (Long Term Support)Local connector in containers (Long Term Support release)
  • A local connector in a Designer instance of IBM App Connect in containers (Support Cycle 2)Local connector in containers (Long Term Support Cycle-2 release)
The following information describes how to use IBM® App Connect to connect Redis to your other applications.

Supported product and API versions

To find out which product and API versions this connector supports, see Detailed System Requirements on the IBM Support page.

Connecting to Redis

To connect App Connect to an Redis account that you want App Connect to use, you need the following connection details, which should be available from your instance. For example, if using IBM Cloud® Databases for Redis, you can obtain the connection values from the Connections panel and Service Credentials panel of your service instance in IBM Cloud.

  • Redis hostname or IP address: Specify the hostname or IP address of the Redis server.
  • Redis port number: Specify the port number of the Redis server.
  • Username: Specify the username required for authentication.
    Note: Currently, admin is the default value, but you can choose to fill the Username field according to your requirement.
    .
  • Password: Specify the password required for authentication.
  • Database number: Optionally specify the database index of the database to connect to, typically from a range of 0 to 15. (The index is generally shown at the end of a Redis URL.) The default is 0.
  • Allow certificate validation: Set to true or false to indicate whether the database is secured using TLS authentication and encryption. If set to true, you'll need to provide an SSL or a TSL certificate to validate against the root certificate from the certificate authority (CA). The default is true.
  • Certificate: If Allow certificate validation is set to true, a certificate is mandatory. Specify the contents of the CA signed certificate for the cluster that hosts the database, in Base64 format. You can copy and paste the Base64-encoded contents directly from your instance.

To connect to a Redis endpoint from the App Connect Designer Connect > Applications and APIs page for the first time, expand Redis, then click Connect.

Tip:

Before you use the account that is created in App Connect in a flow, rename the account to something meaningful that helps you to identify it. To rename the account on the Applications and APIs page, select the account, open its options menu (⋮), then click Rename Account.

What should I consider first?

Before you use App Connect Designer with Redis, take note of the following considerations:

  • (General consideration) You can see lists of the trigger events and actions that are available on the Applications and APIs page of the App Connect Designer.

    For some applications, the events and actions depend on the environment and whether the connector supports configurable events and dynamic discovery of actions. If the application supports configurable events, you see a Show more configurable events link under the events list. If the application supports dynamic discovery of actions, you see a Show more link under the actions list.

  • (General consideration) If you are using multiple accounts for an application, the set of fields that is displayed when you select an action for that application can vary for different accounts. In the flow editor, some applications always provide a curated set of static fields for an action. Other applications use dynamic discovery to retrieve the set of fields that are configured on the instance that you are connected to. For example, if you have two accounts for two instances of an application, the first account might use settings that are ready for immediate use. However, the second account might be configured with extra custom fields.
  • App Connect supports the following Redis deployments:
    Important: Redis versions below v6 are not supported.
  • App Connect supports the following Redis data structures, which are exposed as objects:
    • Hashes
    • Keys
    • Lists
    • Sets
    • Sorted Sets
    • Strings
  • App Connect also supports a subset of Redis commands, which are exposed as actions. You can see which Redis commands are supported by expanding the list of objects on the Applications tab. For example, the following commands are supported for hashes:
    Figure 1. Redis actions available for Hashes
    Redis actions available for Hashes

Events and actions

Redis events

These events are for changes in this application that trigger a flow to start completing the actions in the flow.

Note: Events are not available for changes in this application. You can trigger a flow in other ways, such as at a scheduled interval or at specific dates and times.

Redis actions

Your flow completes these actions on this application.

Hashes
Update or create hash
Check hash field presence
Get hash field count
Get hash field value
Keys
Delete key
Check key presence
Get data type of key
Set expiry timeout of key (seconds/milliseconds)
Set expire-at time of key
Get time to live of key (seconds/milliseconds)
Remove expiry timeout from key
Rename key
Lists
Update or create list
Update list
Get list length
Trim list
Sets
Update or create set
Check set member presence
Get set member count
Sorted sets
Update or create sorted set
Get sorted set member count
Get sorted set member count by score range
Get sorted set member rank
Get sorted set member score
Strings
Update or create string
Append value to string
Get value of string

Examples

Dashboard tile for a template that uses Redis

Use templates to quickly create flows for Redis

Learn how to use App Connect templates to quickly create flows that complete actions on Redis. For example, open the Templates gallery, and then search for Redis.

Dashboard tile for a template that uses Redis