Book Image

Learning Redis

By : Vinoo Das
Book Image

Learning Redis

By: Vinoo Das

Overview of this book

Table of Contents (16 chapters)
Learning Redis
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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.

Publish subscribe model of Redis

Following are the commands...