MATIH Platform is in active MVP development. Documentation reflects current implementation status.
2. Architecture
Overview

Event-Driven Architecture Overview

The MATIH Platform uses an event-driven architecture alongside synchronous REST APIs to handle asynchronous communication, cross-service coordination, and real-time updates. This section documents the event infrastructure, including Apache Kafka for durable event streaming and Redis Pub/Sub for ephemeral real-time notifications.


Event Infrastructure

SystemUse CaseDeliveryPersistence
Apache KafkaDurable events, cross-service coordinationAt-least-once (idempotent producers)Yes (configurable retention)
Redis Pub/SubReal-time notifications, config broadcastsAt-most-once (fire-and-forget)No

The selection rule is straightforward: if the event must not be lost, use Kafka; if the event is ephemeral and latency matters more than durability, use Redis Pub/Sub.


Sections

SectionDescription
Kafka TopologyCluster configuration, topic design, partitioning strategy
Event SchemasThe DataPlaneEvent base class, categories, chaining
Redis Pub/SubReal-time channels, config propagation, AI streaming
WebSocket ArchitectureBrowser-to-server real-time communication
CDC PatternsChange Data Capture for database synchronization

Event Flow Summary

Producer Service
  |
  +-- Durable events --> Kafka --> Consumer Services
  |                                (audit, billing, notification)
  |
  +-- Real-time events --> Redis Pub/Sub --> WebSocket Bridge --> Browser
  |                                        (AI streaming, config updates)
  |
  +-- Database changes --> CDC (Debezium) --> Kafka --> Flink/Consumers

Related Sections