Real-time messaging (PUB/SUB)
Enterprises and social media solutions use messaging in a similar way, and in a way, this forms the backbone of any framework or any solution. Messaging also enables us to have architectures which are loosely coupled where components interact via messages and events. Redis provides mechanism to have real time messaging between components. Unlike other messaging systems, the big difference in the messaging model provided in Redis is as follows:
- It does not store the message after delivering it
- It does not store the message if the client (subscriber) was unable to consume it
This can be a disadvantage if compared to a traditional messaging system but is advantageous where data has importance in real time and need not be stored. The message is always sent sequentially. Apart from that, Redis messaging system is simplistic and easy to learn, and does not have the fluff of some of the other messaging systems.
Following are the commands...