I've have multiple subscribers who are subscribed to the same Redis channel. Does Redis guarantee that all subscribers get all the messages that are pushed into the channel after the subscribers subscribes for the channel ?
Regarding the number of subscribers and publishers, it is limited by the maxclients setting, 10,000 by default.
Aside from data storage, Redis can be used as a Publisher/Subscriber platform. In this pattern, publishers can issue messages to any number of subscribers on a channel. These messages are fire-and-forget, in that if a message is published and no subscribers exists, the message evaporates and cannot be recovered.
Redis and PHP Redis Pub/Sub implements the messaging system where the senders (in redis terminology called publishers) sends the messages while the receivers (subscribers) receive them. The link by which the messages are transferred is called channel. In Redis, a client can subscribe any number of channels.
Redis Pub/Sub is designed for speed (low latency), but only with low numbers of subscribers. Subscribers don't poll and while subscribed/connected are able to receive push notifications very quickly from the Redis broker — in the low milliseconds, even less than 1 millisecond as confirmed by this benchmark.
From redis docs
Messages sent by other clients to these channels will be pushed by Redis to all the subscribed clients.
I guess thats a Yes to your question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With