CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
🌙☀️
Log inStart free
Home/Templates/Retail & E-commerce

🛒 Retail & E-commerce · C4 Architecture · Pro

E-commerce Microservices Architecture

An online store split into microservices: catalog, cart, orders, payments and search, with Kafka events connecting them to shipping and notifications.

More Retail & E-commerce 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

  • Web and mobile apps share one API gateway
  • Each service owns its own database
  • Order events drive shipping and customer emails

Prompt used

An e-commerce platform with a React web app and a mobile app calling an API gateway. Behind it are catalog, search, cart, order and payment microservices. Catalog uses PostgreSQL, search uses Elasticsearch, cart uses Redis. Orders publish events to Kafka, which the shipping service and the notification service consume. Payments go to an external payment gateway.

Mermaid code
C4Container
title E-commerce Platform
Person(shopper, "Shopper", "Browses and buys")
System_Boundary(shop, "Online Store") {
  Container(web, "Web Store", "React", "Browse, cart, checkout")
  Container(gw, "API Gateway", "Node.js", "Auth and routing")
  Container(catalog, "Catalog Service", "Java", "Products and prices")
  Container(cart, "Cart Service", "Go", "Shopping carts")
  Container(orders, "Order Service", "Java", "Orders and status")
  ContainerDb(cartdb, "Cart Store", "Redis", "Active carts")
  ContainerDb(orderdb, "Order DB", "PostgreSQL", "Orders")
  ContainerQueue(kafka, "Events", "Kafka", "Order events")
  Container(ship, "Shipping Service", "Node.js", "Courier bookings")
}
System_Ext(pay, "Payment Gateway", "Cards and UPI")
Rel(shopper, web, "Uses")
Rel(web, gw, "Calls", "HTTPS")
Rel(gw, catalog, "Routes")
Rel(gw, cart, "Routes")
Rel(gw, orders, "Routes")
Rel(cart, cartdb, "Stores")
Rel(orders, orderdb, "Stores")
Rel(orders, pay, "Charges")
Rel(orders, kafka, "Publishes")
Rel(kafka, ship, "Consumed by")

Related templates

SequenceRetail & E-commerce

Checkout and Payment Sequence

What happens when a shopper clicks Pay: stock is reserved, the payment is authorised, the order is created and stock is released again if payment fails.

State MachineRetail & E-commerce

Order Lifecycle State Machine

Every status an online order moves through, from placed to delivered, including cancellations, returns and refunds.

Database ERDRetail & E-commerce

Product Catalog Database Schema

A flexible product catalog: categories, products with variants (size, colour), prices, stock per warehouse and images.

Data FlowRetail & E-commerce

Omnichannel Inventory Sync

How stock stays in sync across stores, warehouses and marketplaces so the same item isn't sold twice.

FlowchartRetail & E-commerce

Returns and Refunds Workflow

How an online store handles a return: eligibility, pickup, quality check at the warehouse and the refund or replacement.

Data FlowRetail & E-commerce

Product Recommendation Engine

How an online store builds 'recommended for you' and 'frequently bought together': click and order data, model training and a fast serving layer.