open source, in-memory data structure store used as:
- Database
- Cache
- Message broker
Data structures
- strings
- Hashes
- Lists
- Sets
- Sorted Sets
- Bitmaps
- Heperloglogs
- Geospatial indexes
Redis has built-in
- replication
- Lua scripting
- LRU eviction
- HA via Redis Sentinel
- Automatic partitioning with Redis Cluster
Pub/Sub
Docker image
docker network create redis
docker run -it --rm --name redis --net redis -p 6379:6379 redis:7.0-alpine
Launch with your own configuration
- Check the self documented redis.conf
- Create /config/redis.conf in the redis project
cd ./redis
docker run -it --rm --name redis --net redis -v ${PWD}/config:/etc/redis/ redis:7.0-alpine redis-server /etc/redis/redis.conf
Security
- Check the redis.conf for:
requirepass
Persistence
RDB – Redis Database
- Point in time snapshots of dataset at specified intervals
- To enable RDB mode in redis.conf:
dbfilename dump.rdb
AOF – Append Only File
- logs every WRITE operations received by the server
- reconstructing original dataset by ops replayed at server startup
- To enable Append Only mode in redis.conf:
appendonly yes
appendfilename “appendonly.aof”
- Recommended to use both
docker volume create redis
cd ./redis/
docker run -it --rm --name redis --net redis -v ${PWD}/config:/etc/redis/ -v redis:/data/ redis:7.0-alpine redis-server /etc/redis/redis.conf