Skip to main content

Redis

Redis is an in-memory data store commonly used for caching, message brokering (e.g., Celery), and session storage. Appliku supports multiple Redis versions and includes Redis in the free plan.

Supported Versions

VersionNotes
Redis 8Latest release
Redis 7Stable, widely used
Redis 6Legacy support
tip

Redis is available on the free plan at no extra cost. It is the recommended choice for Django cache backends, Celery brokers, and session stores.

Provisioning Redis

  1. Open your application in the Appliku dashboard
  2. On the Application Overview page, find the Databases block on the bottom-right sidebar
  3. Click Add Database
  4. Select the desired Redis version from the dropdown
  5. Select the server where Redis should run
  6. Click Create
info

If you cannot find the Databases section, look for the database block on the bottom right of the Application Overview page.

Connection URL

Once provisioned, Appliku injects the Redis connection URL as an environment variable:

redis://host:port/0

The variable name depends on the database name you assigned (e.g., REDIS_URL). Your application can read this variable directly.

Common Use Cases

Django Cache Backend

Use django-redis to configure Redis as your cache backend:

CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": os.environ.get("REDIS_URL", "redis://localhost:6379/0"),
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
},
}
}

Celery Message Broker

Point Celery at your Redis instance:

import os

CELERY_BROKER_URL = os.environ.get("REDIS_URL", "redis://localhost:6379/0")
CELERY_RESULT_BACKEND = os.environ.get("REDIS_URL", "redis://localhost:6379/0")

Session Store

Store Django sessions in Redis for faster access and shared state across processes:

SESSION_ENGINE = "django.contrib.sessions.backends.cache"
SESSION_CACHE_ALIAS = "default"

This requires the cache backend to be configured with Redis (see above).

Managing Redis

From the Application Overview page, click Manage in the Databases card to:

  • Start / Stop / Restart the Redis container
  • View logs for debugging connection issues
  • Delete the instance (data in memory is lost)
note

Redis is an in-memory store. Data does not persist across container restarts unless Redis persistence is configured. For durable data, use PostgreSQL.

Next Steps