IceFireDB-PubSub

IceFireDB-PubSub #

Redis PubSub protocol over a libp2p network: clients keep using SUBSCRIBE/PUBLISH, and the messages travel between nodes across NATs and regions instead of staying inside one Redis instance.

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

redis-cli -p 16379 SUBSCRIBE name      # terminal 1
redis-cli -p 16379 PUBLISH name hello  # terminal 2 (any node in the mesh)

What it is #

PropertyValue
ProtocolRedis RESP — SUBSCRIBE, UNSUBSCRIBE, PSUBSCRIBE, PUBLISH
Transport between nodeslibp2p pubsub (Kademlia DHT + IPFS-network discovery)
Local listenerproxy.local_port, default 16379
Binarybin/IceFireDB-PubSub (-c <config.yaml>)
StateNo persistence: this is a message bus, not a database

Configuration (config/config.yaml) #

KeyMeaningDefault in file
proxy.local_portRESP listener16379
proxy.enable_mtlsMutual TLS between proxiesfalse
p2p.enableTurn the libp2p mesh ontrue
p2p.service_discovery_idRendezvous name — must match across peersp2p_redis_proxy_service_test
p2p.service_command_topicCommand channel inside the meshp2p_redis_proxy_service_topic_test
p2p.service_discover_modeadvertise or announceadvertise
p2p.node_host_ip / node_host_portAddress peers should use (0 = any port)127.0.0.1 / 0
pprof_debug.enable / .port/debug/pprof servertrue / 16060
log.leveldebug, info, warn, errordebug
ip_white_list.enable / .listClient IP allow-listtrue / loopback entries
cache.enable / .max_items_size / .default_expiration (ms) / .cleanup_interval (s)Message cachetrue / 2048 / 5000 / 120
ignore_cmd.enable / .cmd_listDrop selected commandsfalse / []

Notes that bite in real deployments:

  • The discovery id and command topic are the network identity. Copying the config from the sample without changing them puts your cluster in the same mesh as anyone else who did the same.
  • pprof_debug is enabled and listens on 16060 in the sample config. Turn it off, or bind it to loopback and firewall it.
  • The IP allow-list is enabled by default with 127.0.0.1, so a remote client is refused until you add its address.

What it does not do #

  • No message persistence, no replay, no consumer groups, no streams.
  • No cross-mesh bridge: two different service_discovery_ids are two separate worlds.
  • Not part of the NoSQL engine’s command surface — the engine has no SUBSCRIBE at all.

Where it fits #

Use it when web2 clients already publish through Redis and you want the bus to span sites without rewriting them. Pair it with a real queue if you need delivery guarantees; PubSub is best-effort by design.