IceFireDB-Redis-Proxy

IceFireDB-Redis-Proxy #

A RESP proxy in front of Redis (single node or cluster) that replays commands to the other agents in the mesh. Existing Redis applications get multi-site synchronisation without switching databases.

cd IceFireDB-Redis-Proxy
make                                   # → bin/IceFireDB-Redis-Proxy
./bin/IceFireDB-Redis-Proxy -c ./config/config.yaml

redis-cli -p 16379 SET k v

What it is #

PropertyValue
ProtocolRedis RESP on both sides
Backendredisdb.type: node or cluster, redisdb.start_nodes
ReplicationCommands propagated between agents over libp2p
Listenerproxy.local_port, default 16379
Binarybin/IceFireDB-Redis-Proxy (-c <config.yaml>)

Configuration (config/config.yaml) #

KeyMeaningDefault in file
proxy.local_portRESP listener16379
proxy.enable_mtlsMutual TLS for the proxy listenerfalse
redisdb.typenode or clusternode
redisdb.start_nodesComma-separated backend addresses127.0.0.1:6379
redisdb.conn_timeout / conn_read_timeout / conn_write_timeout / conn_alive_timeoutSeconds5 / 1 / 1 / 60
redisdb.conn_pool_sizeBackend connections (0 = short-lived)80
p2p.enable, service_discovery_id, service_command_topic, service_discover_mode, node_host_ip, node_host_portMesh settingssame shape as PubSub
pprof_debug.enable / .portpprof servertrue / 16060
log.levelLog leveldebug
ip_white_list.enable / .listClient allow-listtrue / loopback
cache.enable / .max_items_size / .default_expiration (ms) / .cleanup_interval (s)Proxy cachetrue / 2048 / 5000 / 120
ignore_cmd.enable / .cmd_listCommands to dropfalse / []

Operational notes #

  • redisdb.start_nodes must point at a reachable backend before clients connect; the proxy is not a database and has no storage of its own.
  • Commands are replayed on peers: non-deterministic ones (SPOP, INCRBYFLOAT, anything using server time, EVAL with math.random) will diverge across sites. Prefer deterministic operations, or keep those keys in one site.
  • The cache in front of the backend defaults to enabled with a 5 s expiration — read-after-write from a different client can be stale for up to that window. Disable cache.enable when you need strict reads.
  • pprof_debug is on in the sample config (16060); disable it outside development.
  • Same discovery-id caveat as PubSub: two deployments with the same id share a mesh.

Proxy or engine? #

NeedUse
Keep existing Redis, add multi-site syncIceFireDB-Redis-Proxy
Replace Redis with a Raft-replicated engine and pluggable storageNoSQL engine
Only message fan-outIceFireDB-PubSub