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.
Refer to our dedicated concepts page to find definitions of the different terms referring to Managed Database for Redis™.
Requirements
To perform the following steps, you must first ensure that:
curl
1. Configure your environment variables.
Note: This is an optional step that seeks to simplify your usage of the APIs.
2. Edit the POST request payload you will use to create your Redis™ Database Instance cluster. Replace the parameters in the following example:
Parameter | Description |
---|---|
project_id | REQUIRED 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 console. |
name | Name of the Redis™ Database Instance |
version | REQUIRED Version of the Redis™ engine. To check the list of available versions you can use the folowing endpoint: https://api.scaleway.com/redis/v1/zones/$SCW_ZONE/cluster-versions |
tags | The 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_type | REQUIRED The node type. To check the list of available node types you can use the folowing endpoint: https://api.scaleway.com/redis/v1/zones/$SCW_ZONE/node-types |
user_name | REQUIRED Identifier of the default user, which is created concurrently with the Redis™ Database Instance |
password | REQUIRED Password for the default user |
cluster_size | INTEGER The number of nodes in the Redis™ Database Instance cluster. You can either set it to 1 for a standalone Database Instance, or set it to 3 to 6, for Database Instances in cluster mode |
endpoints | The network configuration of your Redis™ Database Instance. You can either set private_network or public_network . If you set up a Private Network, you must define the ID of the Private Network connected to the cluster, and one IPv4 address endpoint per node. The address must be in the RFC1918 subnet range and follow the CIDR notation method. |
tls_enabled | BOOLEAN Whether or not to enable TLS certificates |
3. Create a Redis™ Database Instance by running the following command. Make sure you include the payload you edited in the previous step.
4. List your Redis™ Database Instances.
5. Retrieve your Redis™ Database Instance IP and port from the response.
Note: In this tutorial, we will use 192.0.2.1
and 6379
as the IP and port, respectively.
6. Connect to your Database Instance with the Redis™ client.
Important: 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 differentiate Database Instances in standalone from those in cluster mode.
Note: The command below 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-<name-of-your-redis-database-instance>.pem
. When using connectors other than redis-cli
, you might need to specify the path to your certificate.
7. Enter the database password that you defined upon creation.
You are now connected to your Managed Database for Redis™.
For more information about Managed Database for Redis™, you can check out the following pages:
A Redis™ Database Instance, also known as a Redis™ cluster, consists of either one standalone node or a cluster composed of three to six nodes. The cluster uses partitioning to split the keyspace. Each partition is replicated and can be reassigned or elected as the primary when necessary. Standalone mode creates a standalone database provisioned on a single node.
List all Redis™ Database Instances (Redis™ cluster) in the specified zone. By default, the Database Instances returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as tags
, name
, organization_id
and version
.
created_at_asc
, created_at_desc
, name_asc
and name_desc
. The default value is created_at_asc
.Create a new Redis™ Database Instance (Redis™ cluster). You must set the zone
, project_id
, version
, node_type
, user_name
and password
parameters. Optionally you can define acl_rules
, endpoints
, tls_enabled
and cluster_settings
.
unknown
, ready
, provisioning
, configuring
, deleting
, error
, autohealing
, locked
, suspended
and initializing
. The default value is unknown
.Retrieve information about a Redis™ Database Instance (Redis™ cluster). Specify the cluster_id
and region
in your request to get information such as id
, status
, version
, tls_enabled
, cluster_settings
, upgradable_versions
and endpoints
about your cluster in the response.
unknown
, ready
, provisioning
, configuring
, deleting
, error
, autohealing
, locked
, suspended
and initializing
. The default value is unknown
.Update the parameters of a Redis™ Database Instance (Redis™ cluster), including name
, tags
, user_name
and password
.
unknown
, ready
, provisioning
, configuring
, deleting
, error
, autohealing
, locked
, suspended
and initializing
. The default value is unknown
.Delete a Redis™ Database Instance (Redis™ cluster), specified by the region
and cluster_id
parameters. Deleting a Database Instance is permanent, and cannot be undone. Note that upon deletion all your data will be lost.
unknown
, ready
, provisioning
, configuring
, deleting
, error
, autohealing
, locked
, suspended
and initializing
. The default value is unknown
.Retrieve the metrics of a Redis™ Database Instance (Redis™ cluster). You can define the period from which to retrieve metrics by specifying the start_date
and end_date
.
Upgrade your standalone Redis™ Database Instance node, either by upgrading to a bigger node type (vertical scaling) or by adding more nodes to your Database Instance to increase your number of endpoints and distribute cache (horizontal scaling). Note that scaling horizontally your Redis™ Database Instance will not renew its TLS certificate. In order to refresh the TLS certificate, you must use the Renew TLS certificate endpoint.
version
, node_type
and cluster_size
may be set.version
, node_type
and cluster_size
may be set.unknown
, ready
, provisioning
, configuring
, deleting
, error
, autohealing
, locked
, suspended
and initializing
. The default value is unknown
.Nodes are the compute units that make up your Redis™ Database Instance. Different node types are available with varying amounts of RAM and vCPU.
List all available node types. By default, the node types returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by
field.
The Redis™ database engine versions available at Scaleway for your clusters.
List the Redis™ database engine versions available. You can define additional parameters for your query, such as include_disabled
, include_beta
, include_deprecated
and version
.
Transport Layer Security (TLS) is an Internet security protocol that enables data to be securely exchanged over a network using in transit encryption. If you set the 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.
Retrieve information about the TLS certificate of a Redis™ Database Instance (Redis™ cluster). Details like name and content are returned in the response.
Renew a TLS certificate for a Redis™ Database Instance (Redis™ cluster). Renewing a certificate means that you will not be able to connect to your Database Instance using the previous certificate. You will also need to download and update the new certificate for all database clients.
unknown
, ready
, provisioning
, configuring
, deleting
, error
, autohealing
, locked
, suspended
and initializing
. The default value is unknown
.Advanced settings allow you to tune the behavior of your Redis™ database engine to better fit your needs. Available settings depend on the version of the Redis™ engine. Note that some settings can only be defined upon the Redis™ engine initialization. These are called init settings. You can find a full list of the settings available in the response body of the list available Redis™ versions endpoint.
Each advanced setting entry has a default value that users can override. The deletion of a setting entry will restore the setting to default value. Some of the defaults values can be different from the engine's defaults, as we optimize them to the Scaleway platform.
Add an advanced setting to a Redis™ Database Instance (Redis™ cluster). You must set the name
and the value
of each setting.
Update an advanced setting for a Redis™ Database Instance (Redis™ cluster). Settings added upon database engine initalization can only be defined once, and cannot, therefore, be updated.
Delete an advanced setting in a Redis™ Database Instance (Redis™ cluster). You must specify the names of the settings you want to delete in the request body.
unknown
, ready
, provisioning
, configuring
, deleting
, error
, autohealing
, locked
, suspended
and initializing
. The default value is unknown
.Network Access Control Lists (ACLs) allow you to manage network inbound traffic by setting up ACL rules.
Retrieve information about an ACL rule of a Redis™ Database Instance (Redis™ cluster). You must specify the acl_id
of the rule in your request.
Delete an ACL rule of a Redis™ Database Instance (Redis™ cluster). You must specify the acl_id
of the rule you want to delete in your request.
unknown
, ready
, provisioning
, configuring
, deleting
, error
, autohealing
, locked
, suspended
and initializing
. The default value is unknown
.Add an additional ACL rule to a Redis™ Database Instance (Redis™ cluster).
Replace all the ACL rules of a Redis™ Database Instance (Redis™ cluster).
Manage endpoint access to your Redis™ Database Instance through Public or Private Networks
Add a new endpoint for a Redis™ Database Instance (Redis™ cluster). You can add private_network
or public_network
specifications to the body of the request.
Update an endpoint for a Redis™ Database Instance (Redis™ cluster). You must specify the cluster_id
and the endpoints
parameters in your request.
Retrieve information about a Redis™ Database Instance (Redis™ cluster) endpoint. Full details about the endpoint, like ips
, port
, private_network
and public_network
specifications are returned in the response.
private_network
and public_network
may be set.private_network
and public_network
may be set.Update information about a Redis™ Database Instance (Redis™ cluster) endpoint. Full details about the endpoint, like ips
, port
, private_network
and public_network
specifications are returned in the response.
private_network
and public_network
may be set.private_network
and public_network
may be set.Delete the endpoint of a Redis™ Database Instance (Redis™ cluster). You must specify the region
and endpoint_id
parameters of the endpoint you want to delete. Note that might need to update any environment configurations that point to the deleted endpoint.
unknown
, ready
, provisioning
, configuring
, deleting
, error
, autohealing
, locked
, suspended
and initializing
. The default value is unknown
.