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.
App Connect Enterprise as a Service connector
Local connector in containers (Continuous Delivery release)
-
Local connector in containers (Long Term Support release)
-
Local connector in containers (Long Term Support Cycle-2 release)
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
to15
. (The index is generally shown at the end of a Redis URL.) The default is0
. - Allow certificate validation: Set to
true
orfalse
to indicate whether the database is secured using TLS authentication and encryption. If set totrue
, you'll need to provide an SSL or a TSL certificate to validate against the root certificate from the certificate authority (CA). The default istrue
. - 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 page for the first time, expand Redis, then click Connect.
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:
- IBM Redis v6.x to v7.x: IBM Cloud Databases for Redis and IBM Compose for Redis
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:
- HSET key field value: Set the string value of a hash field
- HEXISTS key field: Determine if a hash field exists
- HLEN key: Get the number of fields in a hash
- HGET key field: Get the value of a hash field
Figure 1. 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.
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

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.
