CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
🌙☀️
Log inStart free
Home/Templates/SaaS & Cloud

☁️ SaaS & Cloud · C4 Architecture · Pro

Event-Driven Architecture with Kafka

Services that talk through events instead of direct calls: an order service publishes events that inventory, payments, notifications and analytics react to.

More SaaS & Cloud templates

C4 Architecture diagrams are part of Pro. Anyone can view this one; generating and editing it needs Pro.

Drawing diagram…

What this diagram shows

  • Services publish facts (OrderPlaced) and don't wait for each other
  • Each consumer group processes events at its own pace
  • Schema registry keeps event formats compatible

Prompt used

Event-driven architecture: the order service writes an order and publishes OrderPlaced to Kafka using the outbox pattern. Inventory, payment, notification and analytics services consume the topic independently; payment publishes PaymentCompleted or PaymentFailed which the order service consumes to update status. A schema registry manages Avro event schemas, and a dead-letter topic holds events that fail processing.

Mermaid code
C4Container
title Event-Driven Order Processing
Person(customer, "Customer", "Places orders")
System_Boundary(eda, "Event-Driven Platform") {
  Container(order, "Order Service", "Java", "Writes order and outbox")
  ContainerQueue(kafka, "Kafka", "Topics: orders, payments", "Event backbone")
  Container(schema, "Schema Registry", "Avro", "Event contracts")
  Container(inv, "Inventory Service", "Go", "Reserves stock")
  Container(pay, "Payment Service", "Java", "Charges customer")
  Container(notify, "Notification Service", "Node.js", "Email and SMS")
  Container(analytics, "Analytics Sink", "Kafka Connect", "Streams to warehouse")
  ContainerQueue(dlq, "Dead-letter Topic", "Kafka", "Failed events")
}
Rel(customer, order, "Places order")
Rel(order, kafka, "OrderPlaced")
Rel(kafka, inv, "Consumes")
Rel(kafka, pay, "Consumes")
Rel(kafka, notify, "Consumes")
Rel(kafka, analytics, "Consumes")
Rel(pay, kafka, "PaymentCompleted")
Rel(kafka, order, "Updates status")
Rel(order, schema, "Validates schema")
Rel(notify, dlq, "On failure")

Related templates

DeploymentProSaaS & Cloud

Kubernetes Microservices Deployment

How a microservices app runs on Kubernetes in the cloud: ingress, namespaces, services with multiple replicas, managed databases and monitoring.

FlowchartSaaS & Cloud

CI/CD Pipeline Flowchart

A typical CI/CD pipeline from a pull request to production: build, tests, security scans, staging deploy, approval and a canary release.

SequenceSaaS & Cloud

OAuth 2.0 / OpenID Connect Login

The authorization code flow with PKCE used by most modern web and mobile apps to log users in through an identity provider.

C4 ArchitectureProSaaS & Cloud

Multi-Tenant SaaS Architecture

A B2B SaaS product serving many customer organisations from one platform: tenant-aware services, per-tenant data isolation, billing and admin.

DeploymentProSaaS & Cloud

AWS Three-Tier Web Application

The classic three-tier web app on AWS: CloudFront and a load balancer, an autoscaling app tier in private subnets, and a Multi-AZ database.

State MachineSaaS & Cloud

SaaS Subscription Billing Lifecycle

The states of a SaaS customer's subscription: trial, active, past due with retries, paused, cancelled and expired.