Communication & APIs
Also known as: Publish/Subscribe, Publish-Subscribe
A messaging pattern where publishers emit messages to topics without knowing who consumes them, and subscribers receive messages from topics they care about.
Publish/Subscribe (pub/sub) is a messaging pattern that decouples senders from receivers. Publishers post messages to a named topic; subscribers register interest in a topic and receive every message published to it. Neither side knows about the other directly — the broker handles routing.
Pub/sub enables fan-out: one event (a user signs up) triggers many independent reactions (welcome email, analytics event, CRM sync, recommendation refresh) without the publisher needing to know the list of consumers. New consumers can be added without changing the publisher.
Implementations vary in semantics: Redis Pub/Sub is fire-and-forget with no persistence; Google Pub/Sub and AWS SNS+SQS provide durable delivery with retries; Kafka offers persistent, replayable topic logs with consumer groups for parallel consumption. Choose based on whether you need durability, ordering, replay, and at-least-once vs exactly-once delivery.
Use pub/sub for event broadcasting, fan-out workflows, decoupled microservice communication, and any "this happened, react however you want" pattern.
Pub/sub makes the system harder to reason about: who reacts to what is implicit. Debugging requires good observability. Without durability, messages can be lost during consumer downtime.
A buffer that holds messages between producers and consumers, enabling asynchronous processing and decoupling of services.
An HTTP callback that one system sends to another to notify it of an event, enabling push-style integrations between services.
An architectural style for web APIs based on HTTP verbs (GET, POST, PUT, DELETE) acting on resources identified by URLs.
A high-performance RPC framework using HTTP/2, Protocol Buffers, and code generation for type-safe, low-latency service-to-service communication.
A query language for APIs that lets clients request exactly the fields they need in a single request, eliminating over- and under-fetching.
A persistent, bidirectional communication channel between client and server over a single TCP connection — the standard for real-time web features.