Real-Time, Pub/Sub, Webhooks and CDC

Choose the right push or event mechanism and keep event delivery observable, idempotent and replayable.

Advanced⏱ 1 min readLesson 25 of 30#system-design#sse#webhooks#webrtc#pubsub#cdc#events

Event patterns: an event stream can feed pub-sub consumers, webhook delivery, server-sent updates and database change captureEvent patterns: an event stream can feed pub-sub consumers, webhook delivery, server-sent updates and database change capture

PatternBest forKey rule
SSEServer-to-browser updatesOne-way stream; reconnect with event ID
WebhookNotify another serverSign, retry and make receiver idempotent
WebRTCDirect low-latency media/dataNeeds signaling, NAT traversal and fallback
Pub/SubOne event to many internal consumersDefine retention and consumer ownership
CDCPublish committed database changesUse an outbox/transaction log, not app guesses

Delivery is usually at-least-once. Include event ID, schema version, ordering key and trace context; consumers deduplicate and send exhausted failures to a DLQ.