Redis pubsub functionality disabled

Hi!

Trying to use redis subscribe throw node-redis throws the redis error “ERR unknown command ‘subscribe’”. If i’m reading correctly, the subscribe functionality of redis is disabled: Redis unknown command ‘scan’

I would suggest

  • Documenting what redis commands/functions are available in docs
  • Considering activating pubsub through redis if possible. ie: I’m tinkering with a signaling server for WebRTC where clients needs to pass websocket-messages between each other. There seems to be no way to achieve this with multiple app-nodes currently. I’m guessing the same issue would arise for chat-apps etc.

Ah this is a good point.

The problem with pubsub is that it would only be regional, unless we did some magic somewhere.

Our plan is to show people how to run nats.io for this kind of problem. Nats is really great and we’re about 3 days from it running on Fly. :smiley:

Incidentally, you can fake pubsub in Redis by using brpop on lists TTLs for subscribers, and pushing to multiple. That will work cross region right now (even though it takes a bit more code to accomplish).

I’m using Google PubSub to do that, with one subscription per region on multiple topics (delete cache from Redis, etc).

When an instance on Fly starts it checks whether there’s already a subscription for a region, if not it creates one. Then each instance of each region will be subscribed to the same subscription (eg: delete_cache_dfw). Once a subscriber receives a messages correctly it will not be sent to the others in the same region.

Thanks for the replies.
Currently i’m tinkering with a thing that’ll have little to no load, so I’ll just raise the concurrent connection limit and use local memory.
Having a pre-packaged way of doing persistence and state sharing without having to reach for a another bulky cloud account would be a great selling point for fly, like how certain actors in the FE space provide good solutions to their adjacent tech (DNS, serverless functions etc).
Anyway, thanks!