- Quickstarts
- Render Key Value (Redis®-compatible)
Render Key Value
Provision Redis®-compatible datastores for caching and job queues.
Render Key Value provides low-latency in-memory storage that’s ideal for shared caches and job queues. Key Value instances are compatible with virtually all clients that interact with Redis®*.
Paid Key Value instances include disk-backed persistence.
Underlying libraries
-
Newly created Render Key Value instances run Valkey 8.
-
Legacy Key Value instances (created before Feburary 12, 2025) run Redis 6.
- Legacy instances no longer receive version updates, but they will continue to operate as usual.
Quickstarts
These Render quickstarts include steps for provisioning a Key Value instance:
- Deploy a Celery background worker
- Deploy Rails with Sidekiq
- Rails caching with Redis
- Connecting to Render Key Value with ioredis
Create your Key Value instance
-
Go to dashboard.render.com/new/redis, or select New > Key Value in the Render Dashboard.
This form appears:
-
Provide a helpful Name for your instance.
- You can change this value at any time.
-
Choose a Region to run your instance in.
- Choose the same region as your services that will connect to the instance. This minimizes latency and enables communication over your private network.
-
Optionally change the instance’s Maxmemory Policy.
-
Scroll down and select an instance type. This determines its available RAM and connection limit.
-
Click Create Key Value.
You’re all set! Your new instance’s status updates to Available in the Render Dashboard when it’s ready to use.
Connect to your Key Value instance
Every Key Value instance has two different URLs for incoming connections:
- An internal URL for connections from your other Render services running in the same region
- An external URL for connections from everything else
- Before you can use the external URL, you must first enable external connections for your Key Value instance.
Use the internal URL wherever possible. It minimizes latency by enabling communication over your private network.
Both URLs are available from the Connect menu in the top-right corner of your instance’s page in the Render Dashboard:
Key Value instances use redis://
and rediss://
URL schemes. You can connect to your instance using any Redis-compatible client that supports these schemes.
Internal connection examples
To connect with your internal URL, your Key Value instance and your connecting service must belong to the same workspace and run in the same region.
# Connect to your internal Redis instance using the REDIS_URL environment variable
# The REDIS_URL is set to the internal Redis URL e.g. redis://red-343245ndffg023:6379
Sidekiq.configure_server do |config|
config.redis = {url: ENV.REDIS_URL}
end
Sidekiq.configure_client do |config|
config.redis = {url: ENV.REDIS_URL}
end
# Simple example from https://github.com/mperham/sidekiq/wiki/Getting-Started
class HardJob
include Sidekiq::Job
def perform(name, count)
# do something
end
end
HardJob.perform_async('bob', 5)
Enabling external connections
By default, newly created Key Value instances are not reachable at their external URL. To keep your instance secure, you can grant external access to specific sets of IPs.
In the Render Dashboard, go to your Key Value instance’s Info page and scroll down to the Access Control section:
Here you can specify IP address blocks using CIDR notation. The example above grants access to the static outbound IPs for Render’s Ohio region.
These rules apply only to connections that use your Key Value instance’s external URL.
Your Render services in the same region as your Key Value instance can always connect using your instance’s internal URL.
If you attempt to connect from a disallowed IP address, your client will display an error like the following:
AUTH failed: Client IP address is not in the allowlist.
Connecting with CLI tools
The redis-cli
is a useful administrative tool for exploring and manipulating data on your Redis instance. There are 2 ways you can use redis-cli
with your Redis instance:
-
If you have a running non-Docker service,
redis-cli
will be available as part of the environment and is accessible from the service’s Shell page. The service must be in the same region as the Redis instance. You can also SSH into that service and runredis-cli
from there. -
You can run
redis-cli
locally on your machine. You first need to installredis-cli
onto your machine. A copy and pastableredis-cli
command is available in theExternal Access
section of your Redis settings. Note that you first need to enable external connections for your Redis instance.
External connections are TLS secured. The Redis CLI command provided will include the --tls
flag.
After you connect, you can set and get keys using various commands:
oregon-redis.render.com:6379> set "render_is_cool" true
OK
oregon-redis.render.com:6379> get "render_is_cool"
"true"
oregon-redis.render.com:6379> KEYS r*
1) "render_is_cool"
Configure your Key Value instance
Maxmemory policy
Your Key Value instance’s maxmemory policy determines which data it evicts to free space when it reaches its memory limit. You select a policy on instance creation and can change it later.
- For caching use cases, we recommend using
allkeys-lru
. - For job queues, we recommend using
noeviction
to ensure that queued jobs are not lost. - For other use cases, select a policy from the table below based on your requirements.
You can select any of the following policies:
Option |
Description |
Can memory fill up? |
---|---|---|
|
Evict any key using approximated Least Recently Used (LRU). |
No |
|
Don’t evict data. Instead, return an error on write operations whenever the instance is out of memory. |
Yes |
|
Evict using approximated LRU, only keys with an expire set. | Yes |
|
Evict using approximated Least Frequently Used (LFU), only keys with an expire set. |
Yes |
|
Evict any key using approximated LFU. |
No |
|
Remove a random key having an expire set. |
Yes |
|
Remove a random key, any key. |
No |
|
Remove the key with the nearest expire time (minor TTL) |
Yes |
Changing instance types
You can upgrade your Key Value instance to a larger instance type with more RAM and a higher connection limit.
Note the following before you upgrade:
- It is not currently possible to downgrade a Key Value instance.
- Your Key Value instance will be unavailable for a minute or two during the upgrade.
- If you upgrade a Free Key Value instance, all of its data will be lost.
- This is because Free Key Value instances don’t persist data to disk.
-
In the Render Dashboard, open your instance’s Info page and scroll down to the Key Value Instance section.
-
Under Instance Type, click Update.
-
Select a new instance type and click Save Changes.
Need an instance with more than 10 GB of RAM?
Please reach out to our support team in the Render Dashboard.
Blueprint configuration
As with your other services, you can manage your Key Value instances with Blueprints, Render’s infrastructure-as-code model. For details and examples, see the Blueprint YAML Reference.
Data persistence
Paid Key Value instances on Render write their state to disk once per second via the configuration appendfsync everysec
. If a paid instance experiences an interruption (or if you upgrade your instance type), you might lose up to one second of writes.
Free Key Value instances do not persist data to disk.
Metrics
Metrics for memory usage, CPU load, and active connections are available for Key Value instances in the Render Dashboard.
The default metrics granularity shown is 12 hours, which can be adjusted from 5 minutes to 1 week.
*Redis is a registered trademark of Redis Ltd. Any rights therein are reserved to Redis Ltd. Any use by Render Inc is for referential purposes only and does not indicate any sponsorship, endorsement or affiliation between Redis and Render Inc.