v1.3
How to use Redis as a Datasource on Appsmith
This guide helps you to connect your Redis database to Appsmith

Integrating the Redis datasource into Appsmith

To connect your Redis Database instance to Appsmith as a datasources
  1. 1.
    Open Applications Page, select the application to want to configure and click on Edit.
  2. 2.
    On the navigation panel to the left side, Click on + next to Datasources Tab.
  3. 3.
    (Optional) Now click on + Create New, if you already have connected a Datasource previously.
  4. 4.
    Under Databases, Select Redis
  5. 5.
    Enter a name to your Redis datasource (e.g. My Redis Database)
  6. 6.
    Enter your Redis Database configurations inside the Connection section.
    • Enter "0" as Database Number, if you are connecting to the database for the first time.
  7. 7.
    Enter your username and password to your Redis Database under Authentication section.
  8. 8.
    Once done, click on Save and then click on Test.
  9. 9.
    If the Pop up notifies you that My Redis Database datasource is valid, that means your Redis Database's configuration is correct and is to ready to connect to your Appsmith Application. If it Pop up notifies you about any other error, please check your Redis configuration.
Refer to Redis Datasource documentation for more information.

Using Redis as a Datasource

Create keys

Lets create some keys in your Redis Database.
  1. 1.
    After you have added your Datasource, click on New Query +.
Existing Datasorce - New Query
  1. 1.
    Edit your Query name, from Query1 to CreatingKeys
  2. 2.
    From the Query field, create some keys (Enter one by one).
    1
    SET DEVELOPER "me"
    Copied!
    1
    SET ENV "DEV"
    Copied!
    1
    SET DATE "Thursday, 7 October, 2021"
    Copied!
Createing Queries
  1. 1.
    Done. We successfully created some keys.

Fetching Keys

To fetch keys from Redis Database, lets run queries.
  1. 1.
    Again create a new query, and name it as GetKeys
  2. 2.
    From the Query field, lets fetch our existing keys.
    1
    GET DEVELOPER
    Copied!
    Response : me
    1
    GET ENV
    Copied!
    Response : dev
    1
    GET DATE
    Copied!
    Response : Thursday, 7 October, 2021
  3. 3.
    Once you fetch all keys successfully,then you are ready to proceed further.

Binding the data to a widget

  1. 1.
    After running each query, select your desired Widget Type, and click to Add to canvas
Create Widget
  1. 1.
    Now, change the widget name, and its attributes, according to your needs.
Edit Widget
  1. 1.
    Done, not that hard right?

Demo Canvas

Demo
Thats all, now you know how to use Redis as a data source for your Appsmith application.
Last modified 2mo ago