Realtime Technology Glossary

An ever-growing repository of technical terms around realtime technology and beyond.

What is Publish-Subscribe (Pub/Sub)?

Publish/Subscribe is a software design pattern that describes the flow of messages between applications, devices, or services in terms of a publisher-to-subscriber relationship.

Pub/Sub, as it is often called, works like this: a publisher (i.e. any source of data) pushes messages out to interested subscribers (i.e. receivers of data) via live-feed data streams known as channels (or topics). All subscribers to a specific publisher channel are immediately notified when new messages have been published on that channel, and the message data (or payload) is received together with the notification.

As a general messaging pattern that can be implemented across various programming languages and platforms, Publish/Subscribe has a few core principles that are universally useful. These are:

  • Publishers do not need to know anything about their subscribers, and subscribers only have to know the name of the topic channel they are subscribed to. Publishers simply define what data goes in which channel and transmit the channel data once only from one-to-many, so that it can be easily shared out amongst other apps for their own uses.
  • Any publisher may also be a subscriber and data streams can be multiplexed, enabling the creation of interlinked systems that mesh together in an elegant, distributed, and internally-consistent manner.
  • Since intercommunication is event-driven and based on notifications, there is no need for client-to-server polling techniques.
  • Message data types can be anything from strings to complex objects representing text, sensor data, audio, video, or other digital content.

In ordinary usage, particularly in IoT, automation, network operations, or distributed cloud environments, there is often a need for an intermediary layer called a message broker that handles the distribution and filtering of messages, and which also provides low-latency message delivery over dedicated network infrastructure.

You might also like

Overview Of Realtime Streaming Protocols

Overview Of Realtime Streaming Protocols

Making sense of the crowded, complex communication protocol ecosystem.

Download Now
Publish and Subscribe Core Concepts

Publish and Subscribe Core Concepts

Read up on key concepts around the publish and subscribe technology that powers PubNub's global data network.

Read More

Ready To Get Started?

Contact Sales