Redis - alphagov/notifications-manuals GitHub Wiki

We run Redis using Amazon Elasticache.

Redis is used predominantly as a caching layer. Our apps are able to query redis first for an item in the database, and only if it isn't there do they need to retrieve it from the database. If our apps do retrieve the item from the database, they will also add it to redis for future calls.

Not everything in our database is stored in Redis. We store...

We also use Redis for rate limting...

You can purge data in Redis by...

Configuration

Our Redis instance is configured in our Terraform code.

Connecting to Redis

We don't offer a direct connection to Redis at the moment. Instead you need to SSH into the admin app and query it using it the redis python package.

cf ssh notify-admin
/tmp/lifecycle/shell
flask shell

from app.extensions import redis_client

You can then use any redis-cli commands listed in this link https://redis-py.readthedocs.io/en/latest/commands.html. For example:

redis_client.redis_store.keys("*")
redis_client.redis_store.get("your-key-name")
redis_client.redis_store.delete("your-key-name)

Logging

Logs are found in AWS Cloudwatch, in the /aws/elasticache/notify-redis/engine-log and /aws/elasticache/notify-redis/slow-log log groups.

Monitoring and alerting

...

Redis users

...

Backups

...