9148c358d0
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를 Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류. - 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로 자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거, 동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거. - 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming, Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business, Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로, 나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는 title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백). 원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지. - 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서. - 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는 지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지. - Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경. - 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
5.2 KiB
5.2 KiB
id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
| id | title | category | status | canonical_id | aliases | duplicate_of | source_trust_level | confidence_score | verification_status | tags | raw_sources | last_reinforced | github_commit | tech_stack | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| wiki-2026-0508-publish-subscribe-model | Publish-Subscribe Model | 10_Wiki/Topics | verified | self |
|
none | A | 0.95 | applied |
|
2026-05-10 | pending |
|
Publish-Subscribe Model
매 한 줄
"매 publisher 매 subscribers 매 모름 — 매 topic / channel 매 통해 매 decoupled broadcast". 1987 ISIS Toolkit 매 origin, 매 today Kafka / Redis Pub/Sub / NATS / Google Pub/Sub / AWS SNS 매 ubiquitous backbone.
매 핵심
매 model variants
- Topic-based: 매 logical channel name (e.g.
orders.created). - Content-based: 매 message attributes 매 filter — 매 RabbitMQ headers exchange.
- Type-based: 매 message class hierarchy.
- Hybrid: 매 topic + filter (NATS subject wildcards
orders.*.created).
매 delivery semantics
- At-most-once: fire-and-forget (Redis Pub/Sub).
- At-least-once: ack required (Kafka, SQS).
- Exactly-once: 매 idempotent + transactional (Kafka EOS, Pulsar).
매 응용
- Event-driven microservices (orders → fulfillment, billing, notifications).
- Real-time dashboards (Grafana Live, websocket fanout).
- CDC (Debezium → Kafka → consumers).
- IoT telemetry (MQTT — pub-sub variant).
💻 패턴
In-process pub-sub (Python)
from collections import defaultdict
from typing import Callable
class Bus:
def __init__(self):
self.subs: dict[str, list[Callable]] = defaultdict(list)
def subscribe(self, topic, fn): self.subs[topic].append(fn)
def publish(self, topic, msg):
for fn in self.subs[topic]:
fn(msg)
bus = Bus()
bus.subscribe("user.created", lambda u: print(f"welcome {u}"))
bus.publish("user.created", "alice")
Redis Pub/Sub
import redis, json
r = redis.Redis()
# Publisher
r.publish("orders.created", json.dumps({"id": 42, "total": 99}))
# Subscriber
ps = r.pubsub()
ps.subscribe("orders.*")
for msg in ps.listen():
if msg["type"] == "pmessage":
handle(json.loads(msg["data"]))
Kafka producer/consumer (Python)
from confluent_kafka import Producer, Consumer
p = Producer({"bootstrap.servers": "localhost:9092"})
p.produce("orders", key="42", value=b'{"total":99}')
p.flush()
c = Consumer({
"bootstrap.servers": "localhost:9092",
"group.id": "fulfillment",
"auto.offset.reset": "earliest",
})
c.subscribe(["orders"])
while True:
msg = c.poll(1.0)
if msg and not msg.error():
process(msg.value())
c.commit(msg)
NATS with subject wildcards
import nats, asyncio
async def main():
nc = await nats.connect("nats://localhost:4222")
async def cb(msg): print(msg.subject, msg.data)
await nc.subscribe("orders.*.created", cb=cb)
await nc.publish("orders.US.created", b'{"id":42}')
await asyncio.sleep(1)
asyncio.run(main())
Google Cloud Pub/Sub
from google.cloud import pubsub_v1
publisher = pubsub_v1.PublisherClient()
topic = publisher.topic_path("proj", "orders")
publisher.publish(topic, b'{"id":42}', region="us-east1")
sub = pubsub_v1.SubscriberClient()
sub_path = sub.subscription_path("proj", "fulfillment-sub")
def cb(msg): handle(msg.data); msg.ack()
sub.subscribe(sub_path, callback=cb).result()
AsyncAPI schema (governance, 2026)
asyncapi: 3.0.0
channels:
ordersCreated:
address: orders.created
messages:
OrderCreated:
payload:
type: object
properties:
id: {type: integer}
total: {type: number}
매 결정 기준
| 상황 | Approach |
|---|---|
| 매 in-process | Bus / EventEmitter |
| 매 ephemeral, low-latency | Redis Pub/Sub / NATS |
| 매 durable, replay 필요 | Kafka / Pulsar |
| 매 cloud-native, managed | Google Pub/Sub / AWS SNS+SQS |
| 매 IoT / mobile | MQTT |
| 매 fan-in-out, transform | Kafka Streams / Pulsar Functions |
기본값: 매 production EDA — Kafka. 매 simple/ephemeral — NATS.
🔗 Graph
- 부모: Event-Driven Architecture
- 변형: Observer Pattern · Event Bus
- 응용: Event Sourcing · CQRS · CDC
- Adjacent: Kafka · NATS · Redis · MQTT
🤖 LLM 활용
언제: 매 schema design (AsyncAPI generation), 매 consumer code scaffolding, 매 dead-letter analysis. 언제 X: 매 broker selection 매 trust 의 X — workload metrics 직접 측정.
❌ 안티패턴
- Sync pub-sub: 매 publisher block on slow subscriber — 매 async / queue 사용.
- No schema: 매 consumer breakage — Avro/Protobuf + registry 필수.
- Topic explosion: 매 user-per-topic — 매 millions of topics, broker 죽음. 매 partition / filter 사용.
- Duplicate semantics: 매 at-least-once 인데 매 idempotency 없음 — duplicate processing.
🧪 검증 / 중복
- Verified (Eugster et al. — "The Many Faces of Publish/Subscribe" 2003; Kafka docs).
- 신뢰도 A.
🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — full pub-sub pattern entry |