d8a80f6272
이름만 다른(표기 변형) [[위키링크]]를 대상 문서의 canonical 제목으로 치환해 끊겼던 1,200개 링크를 연결. 제목/파일명 정규화 일치만 적용하고 별칭 매칭은 과병합 위험으로 제외(애매성 가드). 원본은 _link_reconcile_backup/ 에 백업. 도구: Datacollect/scripts/link_reconcile_apply.mjs Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
4.8 KiB
4.8 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-simple-event-processing | Simple Event Processing | 10_Wiki/Topics | verified | self |
|
none | A | 0.9 | applied |
|
2026-05-10 | pending |
|
Simple Event Processing
매 한 줄
"매 1 event → 1 reaction. No correlation, no aggregation, no temporal pattern.". 매 EDA 의 simplest tier — notable event 의 detect 후 매 single downstream action 의 trigger. 매 CEP (Complex Event Processing) / ESP (Event Stream Processing) 와 대비되는 매 baseline pattern.
매 핵심
매 SEP vs ESP vs CEP
- SEP: 1 event → 1 action. No state, no correlation.
- ESP: stream 의 windowing, aggregation (Flink, Kafka Streams).
- CEP: pattern matching across events (Drools Fusion, Esper).
매 properties
- Stateless (매 event 의 self-contained).
- Low latency (no buffering / windowing).
- High throughput (parallelize trivially).
- Idempotent handlers preferred (at-least-once delivery).
매 응용
- Order placed → email confirmation.
- User signup → welcome workflow.
- Sensor reading → threshold alert.
- Payment captured → inventory reserve.
- Log line → metric increment.
💻 패턴
Kafka consumer (TypeScript)
import { Kafka } from 'kafkajs';
const kafka = new Kafka({ brokers: ['localhost:9092'] });
const consumer = kafka.consumer({ groupId: 'order-emails' });
await consumer.subscribe({ topic: 'orders.placed' });
await consumer.run({
eachMessage: async ({ message }) => {
const order = JSON.parse(message.value!.toString());
await sendOrderEmail(order.userId, order.id);
},
});
AWS EventBridge rule
import { EventBridgeClient, PutRuleCommand } from '@aws-sdk/client-eventbridge';
await client.send(new PutRuleCommand({
Name: 'order-placed-email',
EventPattern: JSON.stringify({
source: ['app.orders'],
'detail-type': ['OrderPlaced'],
}),
Targets: [{ Arn: lambdaArn, Id: 'send-email' }],
}));
NATS subject handler
import { connect, StringCodec } from 'nats';
const nc = await connect({ servers: 'nats://localhost:4222' });
const sc = StringCodec();
const sub = nc.subscribe('orders.placed');
for await (const msg of sub) {
const order = JSON.parse(sc.decode(msg.data));
await reserveInventory(order);
}
Idempotent handler
async function handleOrderPlaced(event: OrderEvent) {
const seen = await redis.set(`processed:${event.id}`, '1', 'NX', 'EX', 86400);
if (!seen) return; // already handled
await sendEmail(event);
}
Dead-letter handling
await consumer.run({
eachMessage: async ({ message }) => {
try {
await handle(message);
} catch (err) {
await producer.send({
topic: 'orders.placed.dlq',
messages: [{ value: message.value, headers: { error: err.message } }],
});
}
},
});
CloudEvents envelope
const cloudEvent = {
specversion: '1.0',
type: 'com.example.order.placed',
source: '/orders',
id: crypto.randomUUID(),
time: new Date().toISOString(),
data: { orderId, userId, amount },
};
await producer.send({ topic: 'orders.placed', messages: [{ value: JSON.stringify(cloudEvent) }] });
Webhook fan-out
app.post('/webhooks/payment', async (req, res) => {
await eventBus.publish('payment.captured', req.body);
res.status(202).end();
});
매 결정 기준
| 상황 | Approach |
|---|---|
| 1:1 event → action, stateless | SEP |
| Stream aggregation (window sums) | ESP (Flink) |
| Pattern detect (A then B within 5s) | CEP (Esper) |
| Cross-system fan-out | SEP via EventBridge/Kafka |
기본값: Kafka or EventBridge + idempotent stateless handlers.
🔗 Graph
- 부모: Event-Driven-Architecture
- 변형: Event Stream Processing
- 응용: Webhooks · Pub-Sub · Event Sourcing
- Adjacent: CQRS
🤖 LLM 활용
언제: stateless 1:1 event handling — webhook, notification, simple workflow trigger. 언제 X: pattern correlation 필요 — CEP / ESP 사용.
❌ 안티패턴
- Stateful SEP: 매 cross-event state 가지면 ESP 로 reframe.
- No idempotency: at-least-once delivery 에서 매 duplicate side-effect.
- Synchronous webhook chain: 매 cascading failure — async queue 사이로.
🧪 검증 / 중복
- Verified (Hohpe Enterprise Integration Patterns, Confluent docs, AWS EventBridge guide).
- 신뢰도 A.
🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — SEP vs ESP vs CEP, Kafka/EventBridge/NATS patterns |