This video explains the Publish-Subscribe design pattern applied to a banking use case with real-time event-driven architecture using Apache Kafka.
The Transaction Service (Producer) handles banking transactions such as payments, transfers, and deposits. It generates transaction event payloads and publishes them to the Kafka topic transactions.topic.
The Kafka topic acts as the central event stream — durable, partitioned, and real-time — forming a secure, scalable, decoupled, and reliable backbone.
Four independent subscribers process the events:
Fraud Detection Service – Monitors for fraudulent or anomalous transactions and triggers alerts for suspicious activity
Ledger Service – Records immutable ledger entries for accounting and ensures compliance & audit consistency
Notification Service – Sends real-time alerts via SMS, email, and push notifications to customers
Analytics Service – Processes data for analytics, reporting, and business intelligence dashboards
Key Benefits:
Loose Coupling – Producer and subscribers operate completely independently
Real-Time Processing – Events are processed instantly as they occur
Scalability & Reliability – Subscribers can be scaled horizontally for high reliability