발행-구독 채널
발행자와 구독자를 메시지 브로커/라우터를 통해 분리하는 비동기 메시징 패턴.
구조와 동작 원리
구성 요소와 배치 원칙 (조사 기반 개념 설명 · 연결 순서나 토폴로지는 특정하지 않음)
발행자, 구독자, 중간 브로커(토픽/채널)로 구성.
근거 미확인
발신자가 모든 소비자 엔드포인트를 알고 개별 전달·실패 처리해야 하는 직접 결합 문제를 해결.
기대 효과
발행자의 전달 책임을 인프라로 이전해 확장성·응답성과 느슨한 결합을 제공.
트레이드오프
전달 보장이 완전하지 않아 장애 시 유실·중복·지연이 가능하며, 순서·운영 복잡성·비용 트레이드오프가 있음.
기본 pub/sub은 구독 연결·네트워크 장애 시 메시지 유실이 발생할 수 있고, 전달 보장·순서·중복을 별도 설계해야 함.
운영 및 적용 가이드
종합 설명 · 원문 인용으로 검증된 항목과 구분됩니다. 실제 적용 전 확인이 필요합니다.
언제 사용하는가
여러 생산자의 이벤트를 다수 소비자에게 느슨하게 결합해 비동기·실시간으로 전달해야 하는 주문, 알림, 재고, 분석 파이프라인에 적합하다.
시나리오
대형 유통·물류 기업이 전국 5,000개 매장의 주문·재고 이벤트를 중앙 재고, 결제, 알림, 분석 파이프라인에 동시에 전달하려 한다. 주문 서비스는 주문 토픽에 이벤트를 발행하고 각 구독자는 독립적으로 처리한다. 피크 시간 초당 수만 건과 구독자별 장애 격리가 요구된다. 메시지 재처리와 DLQ, 멱등 소비, 백로그 모니터링이 필요하다.
배치 원칙
- 발행자는 브로커/토픽에만 연결
- 구독자는 관심 토픽·구독을 등록하고 자체 처리 파이프라인 보유
- 브로커는 HA·멀티 AZ/리전 또는 전용 네임스페이스에 배치
- DLQ·재처리 저장소·스키마 레지스트리를 브로커와 가까운 데이터 영역에 둠
- 구독자별 큐/채널·필터·보존 정책을 분리
온프레미스
브로커를 직접 설치·패치·업그레이드하고 HA, 백업, 모니터링, 용량 계획, 방화벽, 보안을 직접 운영한다. StatefulSet/PV I/O와 split-brain 복구, 운영 인력·SLA를 고려해야 한다.
클라우드
관리형 브로커로 확장·패치·복제를 위임하고, 리전/엔드포인트 중복, IAM, 암호화, 보존·ack·DLQ·비용 설정을 운영한다. 클라이언트 다중 인스턴스와 장애 조치를 설계한다.
Kubernetes
Operator/Helm/Deployment로 브로커와 구독자를 배포하고 전용 네임스페이스, 리소스 요청·제한, PVC/스토리지, 네트워크 정책, 아웃바운드 연결, readiness/liveness, PDB, 모니터링을 관리한다.
장애 대응
대표 장애는 메시지 유실·중복·역순, 구독자 지연·백로그, 브로커/노드 장애다. 미확인 메시지 나이와 전달 지연을 모니터링하고, 처리 후 ack, 재시도·백오프, DLQ 격리·원인 분석 후 안전 재처리, 멱등 소비자, 브로커 HA/리전 failover로 대응한다.
14개 관점별 근거
조사 당시 근거 보유 여부입니다. 출처의 정확성과 최신성을 별도로 판단하세요.
정의·개요근거 있음
발행자와 구독자를 메시지 브로커/라우터를 통해 분리하는 비동기 메시징 패턴.
a messaging pattern that decouples a message sender (publisher) from interested receivers (subscribers).해결하는 문제근거 있음
발신자가 모든 소비자 엔드포인트를 알고 개별 전달·실패 처리해야 하는 직접 결합 문제를 해결.
When a sender communicates directly with its consumers, it must know the identity and endpoint of every consumer주요 구성 컴포넌트·리소스근거 있음
발행자, 구독자, 중간 브로커(토픽/채널)로 구성.
The topic acts like an intermediary channel between senders and receivers.데이터·에셋 배치 원칙미확인
확인된 원문 근거가 없습니다. 부적합하다는 의미는 아닙니다.
대표 유스케이스근거 있음
온라인 경매, 호출/라이드, 주문 이행, 다창고 재고 관리 등 다수 생산자·소비자 연결에 적합.
online auctions, ride services, order fulfillment, and managing inventory over multiple warehouses are a few examples.시나리오 예시근거 있음
배달 앱에서 고객 주문 이벤트를 발행하면 배달 서비스가 구독해 수신하고, 고객은 주문 상태 이벤트를 구독.
When a meal for delivery is ordered on a mobile app, the customer “publishes” their order and delivery details.부적합 상황·주의근거 있음
기본 pub/sub은 구독 연결·네트워크 장애 시 메시지 유실이 발생할 수 있고, 전달 보장·순서·중복을 별도 설계해야 함.
will lose messages arbitrarily when a subscriber is connecting, when a network failure occurs온프레미스 관점(개발·배포·운영)근거 있음
이벤트 브로커를 온프레미스에 직접 설치할 수 있으나 패치·HA·용량·백업 등 운영 책임이 큼.
It can be installed into a variety of public and private clouds, PaaS, and on-premises environments.클라우드 관점(개발·배포·운영)근거 있음
클라우드 관리형 브로커는 확장·패치·복제를 위임해 운영 부담을 줄이고, 리전·엔드포인트·비용·복원력 설정에 집중.
Zero maintenance. Broker handles scaling, patching, and replication.Kubernetes 관점(개발·배포·운영)근거 있음
Kubernetes에서는 브로커/에이전트·구독자를 전용 네임스페이스와 Deployment/Operator로 배포하고 리소스·네트워크·아웃바운드 연결을 관리.
SAP deploys the Mission Control Agent in a dedicated namespace.장애 대응 관점근거 있음
전달 실패 메시지는 DLQ로 격리하고, 백로그·미확인 메시지 나이를 모니터링하며 원인 분석 후 재처리.
move the message to a dead letter queue (DLQ).장점근거 있음
발행자의 전달 책임을 인프라로 이전해 확장성·응답성과 느슨한 결합을 제공.
increases scalability and responsiveness for senders by offloading the responsibility of the message delivery단점·트레이드오프근거 있음
전달 보장이 완전하지 않아 장애 시 유실·중복·지연이 가능하며, 순서·운영 복잡성·비용 트레이드오프가 있음.
may not fully guarantee that messages can always flow from publishers to subscribers if there is an outage anywhere in between.대표 기술·도구근거 있음
Solace PubSub+, Google Cloud Pub/Sub, Redis Pub/Sub, KubeMQ 등; AMQP/JMS/MQTT/REST/WebSocket 프로토콜.
open APIs and protocols like AMQP, JMS, MQTT, REST and WebSocket.추가 참고 문헌 (24)
- Publish-subscribe pattern - AWS Prescriptive Guidance ↗
- Publisher-Subscriber Pattern - Azure Architecture Center | Microsoft Learn ↗
- What is Pub/Sub Messaging? - Pub/Sub Messaging Explained - AWS ↗
- Publish-Subscribe - Intro to Pub-Sub Messaging | Confluent ↗
- What is Publish-Subscribe (Pub/Sub Model)? ↗
- Event-driven architecture with Pub/Sub | Solutions | Google Cloud Documentation ↗
- Redis pub/sub messaging ↗
- Event-Driven Architecture Style - Azure Architecture Center | Microsoft Learn ↗
- Pub/Sub deployment | Google Kubernetes Engine (GKE) ↗
- Deployment Options ↗
- Deployment Architecture for Kubernetes ↗
- Publish & Subscribe | KubeMQ Developer Center ↗
- SolaceProducts/pubsubplus-kubernetes-quickstart ↗
- How to Build a Hybrid Cloud Platform with Google Cloud Services and On-Premise Kubernetes Infrastructure ↗
- Module 9.2: Managed Message Brokers & Event-Driven Kubernetes | KubeDojo ↗
- Solace with Kubernetes: Event Streaming in Kubernetes Environments ↗
- 5. Advanced Pub-Sub Patterns | ØMQ - The Guide ↗
- Pub/Sub: Introduction to reliability ↗
- Best practices to subscribe to a Pub/Sub topic | Google Cloud Documentation ↗
- Detecting and Handling Delivery Errors in your Event-Driven Architecture ↗
- Troubleshooting a pull subscription | Pub/Sub | Google Cloud Documentation ↗
- Pub/Sub: Introduction to reliability Stay organized with collections Save and categorize content based on your preferences. ↗
- Troubleshooting Pipeline resilience with Dead-Letter Queue Management on GCP Pub/Sub | Wilson Technology ↗
- Dead-letter queues: a small team's safety net — Nic Vannetti ↗