Back to blog

Kafka Architecture Diagram: Event Streaming & Message Queue Patterns (2026)

How to create Kafka architecture diagrams for event streaming systems. Covers brokers, topics, partitions, consumer groups, Kafka Streams, Flink integration, and CDC pipelines — with AI prompt templates.

R
Ryan·Senior AI Engineer
·

Kafka architecture diagrams map the event streaming infrastructure that sits at the core of modern data pipelines, microservice choreography, and real-time analytics platforms. Apache Kafka's distributed, log-based model introduces concepts — brokers, partitions, consumer groups, offsets, and exactly-once semantics — that don't appear in traditional request/response architectures. A clear Kafka architecture diagram makes these concepts legible to developers, data engineers, and stakeholders who need to understand the data flows, durability guarantees, and operational dependencies of your streaming system.

This guide covers the essential building blocks of a Kafka architecture diagram, the most common Kafka topology patterns, and prompt templates for generating accurate diagrams with AI.

Core components of a Kafka architecture diagram

  • Brokers and cluster: The Kafka cluster (typically 3–9 brokers for production), ZooKeeper or KRaft (the metadata quorum that replaced ZooKeeper in Kafka 3.x+), and how leaders and followers are distributed across brokers
  • Topics and partitions: Topics (named event streams), their partition count (parallelism unit), replication factor (durability guarantee), and retention policy (time- or size-based)
  • Producers: Applications that write events to topics — microservices, CDC connectors, stream processors, or event collectors — along with their delivery guarantee (at-most-once, at-least-once, or exactly-once via idempotent producers + transactions)
  • Consumer groups: Named groups of consumers that each read all partitions of a topic collectively, with each partition assigned to exactly one consumer in the group; show consumer group IDs and the services that consume each topic
  • Schema Registry: Confluent Schema Registry (or AWS Glue Schema Registry) that enforces Avro, Protobuf, or JSON Schema compatibility across producers and consumers
  • Kafka Connect: Source connectors (pulling data into Kafka from databases, SaaS APIs, S3) and sink connectors (pushing data from Kafka to data warehouses, search indexes, caches)
  • Stream processors: Kafka Streams apps, Apache Flink jobs, or ksqlDB queries that transform, join, aggregate, or route events between topics
  • Dead letter topics (DLTs): Topics that capture failed-to-process messages for inspection and replay, analogous to SQS DLQs

Prompt examples for common Kafka patterns

Event-driven microservices choreography

"Three microservices communicate via Kafka (Confluent Cloud, 3 brokers, replication factor 3). The Order Service publishes to the 'orders' topic (6 partitions) when a new order is placed. The Inventory Service subscribes to 'orders' and publishes to 'inventory-reserved' or 'inventory-failed' depending on stock. The Payment Service subscribes to 'inventory-reserved' and publishes to 'payments' on completion. The Notification Service subscribes to both 'payments' and 'inventory-failed' and sends emails via SendGrid. Schema Registry enforces Avro schemas. Failed messages go to a dead letter topic consumed by a monitoring Lambda."

CDC pipeline (Postgres → Kafka → data warehouse)

"A Debezium connector reads PostgreSQL WAL (logical replication) and publishes row-level change events (INSERT, UPDATE, DELETE) to Kafka topics named by table: 'pg.public.orders', 'pg.public.customers', 'pg.public.products'. Each topic has 3 partitions and uses Avro serialization with Schema Registry. A Kafka Connect JDBC sink connector reads from these topics and upserts into Snowflake using the primary key. A Flink job joins 'pg.public.orders' with 'pg.public.customers' in a tumbling 1-minute window to produce an 'orders-enriched' topic consumed by a real-time dashboard. Retention is 7 days."

Multi-cluster replication with MirrorMaker 2

"A primary Kafka cluster (us-east-1, 6 brokers) replicates to a disaster recovery cluster (eu-west-1, 3 brokers) using Kafka MirrorMaker 2. Active-passive setup: all writes go to us-east-1; MirrorMaker replicates all topics with 'us-east-1.' prefix to eu-west-1. Consumer offsets are also synced so failover can resume from the last committed offset. The ops team monitors replication lag via Confluent Control Center with alerts on Datadog. In a failover scenario, consumers in eu-west-1 switch to the replicated topics."

Real-time ML feature pipeline

"User clickstream events are published to Kafka's 'clickstream' topic (12 partitions) from a web SDK. A Flink job reads from 'clickstream', computes per-user features (30-second session window: page_views, click_count, time_on_page), and writes to the 'user-features' topic and simultaneously to Redis as a feature store. An ML inference service reads the feature store at prediction time. Another Flink job joins 'clickstream' with 'user-features' to detect anomalies and publishes to a 'fraud-alerts' topic consumed by the fraud review team's Slack integration."

Kafka vs other message systems

SystemModelBest forRetention
Apache KafkaDistributed log, pull-basedHigh-throughput streaming, event sourcing, CDCConfigurable (days–forever)
AWS SQSQueue, at-least-onceDecoupled microservices, Lambda triggersUp to 14 days
RabbitMQMessage broker, push-basedComplex routing (exchanges, bindings)Until consumed
Google Pub/SubManaged pub/subGCP-native event distributionUp to 7 days
Azure Event HubsKafka-compatible managed serviceAzure-native, Kafka protocol migrationUp to 90 days
RedpandaKafka-compatible, no ZooKeeperLower latency, simpler ops than KafkaConfigurable

What to annotate on a Kafka diagram

  • Partition count per topic: This determines the maximum consumer group parallelism and affects throughput — annotate it directly on the topic box
  • Replication factor: Show the replication factor (typically 3 for production) as it represents the durability guarantee
  • Delivery guarantees: Label each producer → topic edge with its delivery semantic (at-least-once, exactly-once via transactions) and each consumer with its offset commit strategy (auto-commit vs manual)
  • Consumer group IDs: Each consumer group reads a topic independently — show all consumer group IDs so reviewers can identify double-consumption or missing consumers
  • Schema format: Annotate Avro, Protobuf, or JSON on each topic so readers know whether schema evolution is enforced

Related guides: streaming data architecture, event sourcing and CQRS, microservice architecture patterns, and streaming architecture use cases.

Ready to try it yourself?

Start Creating - Free