Pub/Sub Design Pattern
In cloud-based and distributed applications, components of the system often need to provide information to other components as events happen.
Publish/subscribe messaging, or pub/sub design pattern is a form of asynchronous service-to-service communication used in serverless and micro-services architectures. In a pub/sub model, any message published to a topic is immediately received by all of the subscribers to the topic. Pub/sub messaging can be used to enable event-driven architectures or to decouple applications in order to increase performance, reliability, and scalability.
All the modern cloud-based solutions platforms come with built-in support for publisher subscriber service components.
Use Case
Let’s say we want to develop a notification delivery service where servers would want to send Emails, SMS, and iOS push notifications as well. First, we will need to understand how we send notifications to multiple platforms in the first place, so let’s dig a little deeper and understand notification types.
Notification Types
1. iOS Push Notification
A provider sends notifications do Apple Push Notification Service, a remote service provided by Apple to push notifications to iOS devices.