Skip to content
D2 templates

Microservices with bus

Gateway fronts services; bus fans out to async workers.

Template previewD2
G client client gateway gateway client->gateway auth auth gateway->auth orders orders gateway->orders catalog catalog gateway->catalog payments payments gateway->payments bus bus orders->bus order.created payments->bus payment.ok postgres postgres payments->postgres writes email_worker email_worker bus->email_worker analytics analytics bus->analytics

What this template contains

Source
12 lines

Make it your own.

client -> gateway

gateway -> auth
gateway -> orders
gateway -> catalog
gateway -> payments

orders -> bus: order.created
payments -> bus: payment.ok

bus -> email_worker
bus -> analytics

payments -> postgres: writes
postgres.shape: cylinder
bus.shape: queue