Patterns
35 items
35 items
Decoupled message distribution through topics
The Publish/Subscribe pattern decouples message producers (publishers) from consumers (subscribers) through an intermediary message broker. Publishers send messages to named topics without knowing who will receive them, while subscribers express interest in one or more topics and receive only relevant messages. This decoupling enables scalable, flexible communication in distributed systems and is the foundation of event-driven architectures.
Publishers and subscribers never communicate directly. Instead, they interact through named topics managed by a message broker. This loose coupling is fundamental to microservices architectures.
Subscribers can dynamically join or leave topics at runtime without affecting publishers or other subscribers. When a message is published, the broker automatically fans it out to all active subscribers.
Most pub/sub systems guarantee at-least-once delivery: messages may be delivered multiple times during failures. This requires subscribers to implement idempotent message handlers.
In traditional point-to-point communication, services make direct requests to each other. This creates tight coupling: availability coupling, temporal coupling, knowledge coupling, and scalability limitations.