Why does Redis, a datastore, have Pub/Sub features? My first thought is that it's the wrong layer to implement such a thing. But maybe I need to think outside the box.
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.
Redis Pub/Sub is the oldest style of messaging pattern supported by Redis and uses a data type called a “channel,” which supports typical pub/sub operations, such as publish and subscribe. It's considered loosely coupled because publishers and subscribers don't know about each other.
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.
Using Redis for pub/sub This means that Redis is good for real-time messaging and systems that send data quickly without delay. Other use cases with caching include the following.
Redis is defined as data structure server. Redis provides multiple functionality like memcache, queue, pubsub etc. This is very useful for a cloudapp/webstack where 3 components RabbitMQ(queuing) + XMPP(pubsub) + Memcache can be currently replaced with redis. Queuing is not as feature rich as RabbitMQ though.
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