39 templates
D2 templates
Modern declarative architecture-diagram language. Concise syntax: `api -> db: queries` becomes an arrow with a label; `auth: { login -> session }` groups into a container. Renders through our Graphviz pipeline.
Three-tier web app
Browser → Load balancer → API pool → Database / Cache.
ArchitectureMicroservices with bus
Gateway fronts services; bus fans out to async workers.
ArchitectureKubernetes deployment
Ingress → Service → Deployment → Pods; ConfigMap + Secret.
ArchitectureAWS three-tier
Route53 → CloudFront → ALB → ECS → RDS / ElastiCache.
ArchitectureCI/CD pipeline
PR → tests → build → staging → manual approve → prod.
ArchitectureEvent-driven order flow
Order created → Payment → Inventory → Shipping, all via events.
ArchitectureRAG pipeline
Ingestion path + query path meeting at retrieval.
AI & PipelinesMulti-region failover
Two regions behind a global DNS; replicated DBs.
ArchitectureModern data warehouse
Sources → CDC → Lake → dbt → Warehouse → BI / ML.
ArchitectureSAML SSO flow
User → SP → IdP redirect → assertion → SP session.
ArchitectureD2 — event-driven architecture
Producers, queue, consumers with retry topic.
ArchitectureD2 — Gen-AI application
RAG-style architecture with retriever and reranker.
AI & PipelinesD2 — CDN edge architecture
Edge / regional / origin caching tiers.
ArchitectureD2 — saga (booking)
Hotel + flight + car saga with compensating actions.
ArchitectureD2 — IoT edge processing
Field devices, edge gateways, cloud ingest.
ArchitectureMicroservices Architecture (D2)
Gateway, services, datastores, and an event bus in D2.
ArchitectureData Pipeline (ETL) — D2
Extract, transform, load with a warehouse and BI layer.
Data & SchemaAgentic AI Workflow (D2)
A planning agent that calls tools in a loop until done.
AI & PipelinesEvent-driven Architecture (D2) — Broker and Event Store
Producers, a broker, and consumers in an event-driven system.
ArchitectureThree-tier Web App (D2)
The classic presentation / logic / data tiers.
ArchitectureKubernetes Service (D2)
Ingress to a service load-balancing across pods.
ArchitectureEvent-Driven Architecture (D2) — Dead-Letter Queue
Producer, topic, consumers and a dead-letter queue.
ArchitectureCI/CD Pipeline (D2)
Commit through build, test, scan and deploy stages.
Operations & OpsMicroservices Mesh (D2)
A gateway fronting services that call each other and data stores.
ArchitectureData Pipeline (D2)
Ingest to lake to warehouse, feeding BI and ML.
Data & SchemaNetwork Tiers (D2)
Internet through WAF and load balancer to web, API and DB.
ArchitectureServerless Architecture (D2)
API gateway, functions, a queue and a table.
ArchitectureCQRS + Event Sourcing (D2)
Separate command and query paths with a projector.
ArchitectureStrangler Migration (D2)
A strangler facade peeling services off a monolith.
ArchitectureML Model Serving (D2)
Online inference with a feature store and monitoring.
AI & PipelinesPayment Flow (D2)
Checkout through gateway and bank to a ledger.
ArchitectureIoT Telemetry (D2)
Sensors through a broker to storage and alerts.
ArchitectureMulti-Region Deployment (D2)
DNS routing to regional stacks with replication.
ArchitectureFeature Store Architecture (D2)
Streaming and batch pipelines feeding an online and offline feature store, with a drift monitor closing the retraining loop.
AI & PipelinesNetwork Operations Topology (D2)
Access, metro aggregation and core layers of a fixed-line network with the alarm path from telemetry to a field truck roll.
Operations & OpsPrimary Substation and Feeders (D2)
A 132/33 kV primary substation with twin transformers, a normally open bus coupler and four feeders including a dual-fed hospital.
Operations & OpsPayment Segregation of Duties (D2)
Requisition to bank release with the segregation-of-duties rules that stop a preparer authorising or a payables clerk editing vendor bank details.
Risk & ReliabilityKanban Pull System with Supermarket (D2)
Withdrawal and production kanban circulating between assembly, a two-lane supermarket and the press shop, levelled through a heijunka box.
Lean & FlowFranchise Operating Model (D2)
What the franchisor supplies, what the agreement extracts and how unit economics flow back as royalty and marketing levy.
Business & Strategy