Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Redis have Pub/Sub capabilities?

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.

like image 889
John Bachir Avatar asked Feb 08 '11 21:02

John Bachir


People also ask

Why does Redis have pub sub?

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.

What is Redis pub sub?

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.

How does Redis implement Pub Sub?

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.

Is Redis Pub/Sub real time?

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.


1 Answers

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.

like image 148
Anoop Avatar answered Sep 20 '22 18:09

Anoop