Redis is an in-memory data structure store, used as a distributed, in-memory key–value database, cache and message broker, with optional durability. Redis supports different kinds of abstract data structures, such as strings, lists, maps, sets, sorted sets, HyperLogLogs, bitmaps, streams, and spatial indexes. [Redis Official Documentation](https://redis.io)
(WE G)ot Redisđź”—
- Workflow Enablement Group (WEG) is proud to offer Redis hosted as a Docker container in our new LC Kubernetes/Openshift cluster.
- We currently support version 7.
Redis Usage Tips
Redis is a high-performance in-memory data store commonly used for caching, session management, and message brokering. Below are some tips for connecting to Redis, along with best practices for reliability and security.
Tips:
Tip | Details |
---|---|
Use SSL | Always use the rediss:// scheme for secure connections. |
Manage Secrets Securely | Store Redis credentials and connection details securely, for example in a secrets manager, and avoid hard coding them in your repository files. To help prevent accidental exposure, use a .gitignore file to exclude any sensitive configuration files from version control. |
Add Reconnection Logic | Wrap connection logic in try/except blocks to handle network issues or authentication errors, and implement reconnection logic to automatically retry connecting if the connection is interrupted. |
Close Connections | Explicitly close your Redis connections with conn.close() when they are no longer needed to free resources. |
Use Connection Pools | For applications with frequent Redis usage, use connection pooling to efficiently manage multiple connections. |
Additional Resources: