What is Redis Pub and Sub?
Posted by stxck_underflow@reddit | learnprogramming | View on Reddit | 4 comments
What is Redis pub and sub? I am building an application with Socket.io and Node.js. Is it necessary to use Redis pub and sub while using node clusters?
plastikmissile@reddit
I don't want to sound like I'm trolling you, but have you at least tried to Google it? A huge part of being a professional programmer are research skills. You can even ask ChatGPT to explain it for you.
stxck_underflow@reddit (OP)
Yeah, I can understand. Everyone has Google, so what is the purpose of this subreddit?
plastikmissile@reddit
For general questions like "what is X" you'll get a much better answer from Google, because it will take you to articles that were written specifically for beginners in mind, in a level of detail that you can't get from a typical reddit post. Asking in Reddit is for clarifying questions or questions about details that are not so easy to Google.
dswpro@reddit
PUB is short for Publish. SUB is short for subscribe. Redis implements a Pub/Sub "pattern" by providing a simple and scalable messaging system that different systems, applications or software components can interact with. Think of it as a directed broadcast system. Producers can publish information into a named "channel", and any subscribers (who are currently connected) will immediately receive that message. This pattern is useful when you don't know how many systems or applications need to listen for events now or in the future.