Django, Redis & AWS ElastiCache primary/replica cluster

AWS’s ElastiCache service is a convenient way to launch a Redis cluster. If you’re using Django, both django-redis-cache and django-redis packages support an ElastiCache Redis instance. If you are launching ElastiCache Redis with any amount of replicas, some additional master-slave configuration is needed in your Django settings.

Here is an example of an ElastiCache Redis cluster with a primary instance and two replicas:

The following is an example of the correct settings for this cluster if you’re using django-redis-cache backend:

    'default': {
        'BACKEND': 'redis_cache.RedisCache',
        'LOCATION': [
        'OPTIONS': {
            'DB': 0,
            'MASTER_CACHE': ""

Leave a Reply

Your email address will not be published. Required fields are marked *