Background
RedissonConfig currently connects to a single Redis node (useSingleServer). A single node is a single point of failure — if it goes down, the entire flash sale halts. Production deployments need either Redis Sentinel (leader election + failover) or Redis Cluster (sharding + replication).
Proposed Change
Make the connection mode configurable:
flashsale:
redis:
mode: single # single | sentinel | cluster
sentinel:
master-name: mymaster
nodes:
- redis-sentinel-1:26379
- redis-sentinel-2:26379
- redis-sentinel-3:26379
RedissonConfig switches on flashsale.redis.mode:
return switch (properties.redis().mode()) {
case SINGLE -> buildSingleServer(properties);
case SENTINEL -> buildSentinelServer(properties);
case CLUSTER -> buildClusterServer(properties);
};
Docker Compose
Add a 3-node Sentinel setup to docker-compose.yml under a redis-ha profile so the default single-node setup is unchanged for local dev.
Acceptance Criteria
Background
RedissonConfigcurrently connects to a single Redis node (useSingleServer). A single node is a single point of failure — if it goes down, the entire flash sale halts. Production deployments need either Redis Sentinel (leader election + failover) or Redis Cluster (sharding + replication).Proposed Change
Make the connection mode configurable:
RedissonConfigswitches onflashsale.redis.mode:Docker Compose
Add a 3-node Sentinel setup to
docker-compose.ymlunder aredis-haprofile so the default single-node setup is unchanged for local dev.Acceptance Criteria
FlashSalePropertiesextended with aredissectionRedissonConfigswitches connection mode based on config