Reference Architecture
The Klok Integration Reference Architecture is event-driven integration around one central broker, with strict hierarchy, standardized route patterns, broker-based decoupling, and living context.
Architectural Vision
Klok is designed to provide enterprise-grade governance without an enterprise-grade bottleneck. It does this through:
- Decoupling: systems communicate through the broker, not direct system-to-system links.
- Standardization: integrations share framework patterns and naming standards.
- Observability: documentation and diagrams can be generated from code, runtime state, and context snapshots.
Hierarchy
- Realm: physical infrastructure boundary.
- Tenant: legal or organizational boundary.
- Domain: functional or information boundary.
Broker
Apache Pulsar acts as the central message broker. It provides multi-tenancy, persistent topics, subscriptions, and replay capabilities. In Klok, broker topics carry CloudEvents with governed data models; Topics, Subscriptions And The Broker explains how a subscription reads a topic as a stream or as a queue.
Route Legs
Route legs are independently deployable services:
- Ingress: external system -> topic.
- Processing: topic -> topic.
- Egress: topic -> external system.
Each leg should be observable, traceable, and represented in Integration Context.
Living Context
The architecture is not only stored in documents. It is reconstructed and validated from:
- Admin GUI metadata.
- Git repositories.
- CI/CD scans.
- Generated documentation.
- Runtime observations.
- Logs and broker events.
This is what makes impact analysis and AI-assisted development practical.