REDIS
Install & redis.conf
version: "3.6"
services:
redis:
image: "redis:5"
container_name: redis
restart: always
ports:
- 6379:6379
entrypoint: redis-server /usr/local/etc/redis/redis.conf
volumes:
- /mnt/ssd/redis:/data/redis
- $PWD/conf/redis.conf:/usr/local/etc/redis/redis.conf
networks:
net:
ipv4_address: 172.16.8.3
networks:
net:
name: "net_optimize"
ipam:
driver: default
config:
- subnet: "172.16.8.0/24"
General Commands
Redis vs Memcached
| Attribute | memcached | redis |
|---|---|---|
| struct | key/value | key/value + list, set, hash etc. |
| backup | × | ✓ |
| Persistence | × | ✓ |
| transcations | × | ✓ |
| consistency | strong (by cas) | weak |
| thread | multi | single |
| memory | physical | physical & swap |
Page Source