โฑ 7 min read
Recommended Reading
Executive summary
Kafka as an integration backbone can reduce runtime coupling but increases design-time coupling via event contracts. Kafkaโs partitioned topic model enables scalable distribution, but it also creates operational complexity and makes schema evolution governance essential. integration architecture diagram
- Trade-offs: decoupling, latency, consistency
- Operational trade-offs: monitoring, failure modes
- Schema evolution (compatibility).
Benefits, trade-offs, and mitigations
Kafka as an integration backbone replaces hundreds of point-to-point connections with a centralized event bus. The architectural benefits are significant, but so are the trade-offs. Honest assessment of both is essential for architecture decision-making. modeling integration architecture with ArchiMate
Benefit: Decoupling. Producers and consumers are independent. A producer publishes events without knowing who consumes them. Consumers subscribe without knowing who produces. This enables independent deployment, scaling, and evolution โ the holy grail of microservice architecture.
Trade-off: Eventual consistency. When data moves asynchronously through Kafka, consumers see updates milliseconds to seconds after they happen. For many use cases this is fine. For others (real-time trading, inventory reservation) it is not. Mitigation: Use synchronous APIs for consistency-critical paths and Kafka for everything else. Hybrid is not a failure โ it is pragmatic architecture.
Trade-off: Operational complexity. A Kafka cluster is a distributed system that requires expertise to operate: broker management, partition rebalancing, replication monitoring, upgrade coordination. Mitigation: Dedicate a platform team (2-3 engineers minimum) or use a managed service (Confluent Cloud, AWS MSK).
Trade-off: Debugging difficulty. When a business process spans 5 services communicating via Kafka, tracing a single transaction requires correlating events across multiple topics. Mitigation: Implement distributed tracing (OpenTelemetry) from day one. Include a correlation ID in every event header. Build tooling to reconstruct transaction flows from topic data.
The integration decision tree
Before committing to Kafka as the integration backbone, run every integration use case through a five-question decision tree. Each question filters out scenarios where a simpler technology would suffice. application cooperation diagram
Question 1: Does this integration need request-reply semantics? If Service A needs an immediate answer from Service B (credit check, inventory lookup, authentication), use REST or gRPC. Routing synchronous interactions through Kafka adds latency and the complexity of correlating requests with responses across topics. Reserve Kafka for fire-and-forget and event notification patterns.
Question 2: Will multiple independent consumers need this data? If only two systems exchange data, a point-to-point queue (SQS, RabbitMQ) is simpler and cheaper. Kafka shines when the same event stream feeds analytics, search indexing, audit logging, and downstream services simultaneously โ each consumer reads independently without affecting others.
Question 3: Is event replay a requirement? If consumers must reprocess historical events (rebuilding a search index, recovering from a bug, training ML models on historical data), Kafka's persistent log is essential. Traditional message queues delete messages after consumption.
Question 4: Does throughput exceed 10,000 messages per second? Below this threshold, simpler technologies handle the load. Above it, Kafka's partitioned architecture enables horizontal scaling that queues cannot match without complex sharding.
Question 5: Does the team have Kafka expertise? Operating a Kafka cluster requires distributed systems knowledge. If the team lacks this expertise and cannot acquire it, use a managed service (Confluent Cloud, AWS MSK, Azure Event Hubs) or consider a simpler alternative like AWS EventBridge or Google Pub/Sub.
Architecture patterns for the Kafka backbone
Organizations that pass the decision tree typically implement one of three backbone patterns.
Hub-and-spoke: A single Kafka cluster serves as the enterprise integration hub. All domains publish to and consume from this cluster. Advantages: single point of governance, simplified operations. Disadvantages: single point of failure, contention between domains, difficult to scale beyond one geography.
Federated clusters: Each major domain operates its own Kafka cluster. MirrorMaker 2 replicates selected topics between clusters for cross-domain integration. Advantages: domain autonomy, geographic distribution, failure isolation. Disadvantages: operational overhead of multiple clusters, replication lag, more complex governance.
Hybrid: A central cluster handles cross-domain integration topics while domain-specific clusters handle local event flows. This balances governance (cross-domain events are centrally managed) with autonomy (domain teams own their local event architecture). Most large enterprises evolve toward this pattern.
Migration strategy: from point-to-point to Kafka backbone
Replacing hundreds of point-to-point integrations with a Kafka backbone does not happen overnight. The migration follows three phases, each delivering incremental value while reducing risk. ArchiMate for digital transformation
Phase 1: Shadow mode (weeks 1-4). Deploy Kafka alongside existing integrations. Producers write to both the legacy integration and the Kafka topic simultaneously. Consumers read from the legacy integration (primary) and validate against Kafka data (secondary). This proves that Kafka receives the same data as the legacy path without any production risk.
Phase 2: Kafka-primary (weeks 5-12). Switch consumers to read from Kafka as the primary source, with the legacy integration as fallback. Monitor consumer lag, data completeness, and end-to-end latency. If issues arise, consumers can switch back to the legacy path within minutes. Each integration migrates independently โ there is no big-bang cutover.
Phase 3: Legacy decommission (weeks 13+). Once all consumers have validated on the Kafka path, decommission the legacy integration. Document the migration in the architecture repository โ update the integration landscape view to reflect the new Kafka-based topology. Calculate and report the savings: reduced license costs (retired middleware), operational savings (fewer integration points to monitor), and agility gains (new consumers can subscribe without building new integrations).
Measuring backbone health
An integration backbone requires continuous health monitoring. Define and track four key metrics.
End-to-end latency: The time from event production to consumer processing. Measure at the 50th, 95th, and 99th percentiles. Alert on 99th percentile breaches โ they indicate systemic problems before they become outages. Target: under 100ms for 95% of events in a well-tuned cluster.
Consumer lag: The number of unprocessed messages per consumer group. Lag indicates that consumers cannot keep up with production rate. Sustained lag growth triggers investigation: is the consumer too slow (code problem), or is production spiking (upstream problem)?
Schema compatibility rate: The percentage of schema registrations that pass compatibility checks on the first attempt. Low rates indicate that teams are not following schema design best practices. Target: above 90% first-attempt success.
Topic utilization: The ratio of active topics (with active producers and consumers) to total topics. Low utilization indicates topic sprawl โ topics that were created but abandoned. Target: above 85% utilization; topics below threshold enter the deprecation review process.
If you'd like hands-on training tailored to your team (Sparx Enterprise Architect, ArchiMate, TOGAF, BPMN, SysML, Apache Kafka, or the Archi tool), you can reach us via our contact page.
Frequently Asked Questions
How is integration architecture modeled in ArchiMate?
Integration architecture in ArchiMate is modeled using Application Components (the systems being integrated), Application Services (the capabilities exposed), Application Interfaces (the integration endpoints), and Serving relationships showing data flows. Technology interfaces model the underlying protocols and middleware.
What is the difference between API integration and event-driven integration?
API integration uses synchronous request-response patterns where a consumer calls a provider and waits for a response. Event-driven integration uses asynchronous message publishing where producers emit events that consumers subscribe to โ decoupling systems and improving resilience.
How does ArchiMate model middleware and ESB?
Middleware and ESB platforms appear in ArchiMate as Application Components in the Application layer that expose Integration Services. They aggregate connections from multiple source and target systems, shown through Serving and Association relationships to all connected applications.