Managed Database for Redis™ is a low-latency caching solution. It allows you to easily set up a secure cache and lighten the load on your main database. Based on the in-memory data storage, Managed Database for Redis™ improves your application response time and helps you provide a better experience to your users.
Using Managed Database for Redis™ as a cache optimizes the speed of your requests as copies of the most frequently used data are stored in memory, making them accessible in milliseconds.
Concepts
Refer to our dedicated concepts pageOpen in new context to find definitions of the different terms referring to Managed Database for Redis™.
Quickstart
-
Configure your environment variables.
Note
This is an optional step that seeks to simplify your usage of the APIs
Code -
Edit the POST request payload you will use to create your Redis™ Database Instance cluster. Replace the parameters in the following example:
CodeParameter Description project_idREQUIRED The ID of the Project you want to create your Database Instance in. To find your Project ID you can list the projects or consult the Scaleway consoleOpen in new context. nameName of the Redis™ Database Instance versionREQUIRED Version of the Redis™ engine. To check the list of available versions you can use the following endpoint: https://api.scaleway.com/redis/v1/zones/$SCW_ZONE/cluster-versionstagsThe list of tags ["tag1", "tag2", ...]that will be associated with the Redis™ Database Instance. Tags can be appended to the query of the List Database Instances call to show a list of the Database Instances using a specific tag. You can also combine tags to list Database Instances that possess all of the appended tags.node_typeREQUIRED The node type. To check the list of available node types you can use the following endpoint: https://api.scaleway.com/redis/v1/zones/$SCW_ZONE/node-typesuser_nameREQUIRED Identifier of the default user, which is created concurrently with the Redis™ Database Instance passwordREQUIRED Password for the default user cluster_sizeINTEGER The number of nodes in the Redis™ Database Instance cluster. You can either set it to 1 for a standalone Database Instance, 2 for High Availability, or from 3 to 6, for cluster mode tls_enabledBOOLEAN Whether or not to enable TLS certificates -
Create a Redis™ Database Instance by running the following command. Make sure you include the payload you edited in the previous step.
Code -
List your Redis™ Database Instances.
Code -
Retrieve your Redis™ Database Instance IP and port from the response.
Note
In this tutorial, we will use and as the IP and port, respectively
-
Connect to your Database Instance with the Redis™ client.
Note
You can use only one of your node IP addresses at a time to connect to your Redis™ Database Instance, as the Redis™ CLI does not support cluster mode.
CodeNote
The command above uses TLS to add an extra layer of security to your connection. The TLS certificate is generated automatically if you set tls_enabled to true. The certificates take on the following name structure: `SSL_redis-
Important
Scaleway supports TLS1.2 and TLS1.3. If you use older versions of
libssl, you might encounter connexion issues when usingredis-cli. If this is the case, we recommend you check the libssl versions installed on your local machine and update if necessary. -
Enter the database password that you defined upon creation.
You are now connected to your Managed Database for Redis™.
Requirement
To perform the following steps, you must first ensure that:
- you have an account and are logged into the Scaleway consoleOpen in new context
- you have created an API keyOpen in new context and that the API key has sufficient IAM permissionsOpen in new context to perform the actions described on this page.
- you have installed
curlOpen in new context
Going Further
For more information about Managed Database for Redis™, you can check out the following pages:
tls_enabled parameter to true when creating or updating a cluster, a TLS certificate will be automatically generated for your Redis™ Database Instance to ensure secure connections.