Network & Software Architecture Mapping
Diagram Type Selection
| Need |
Diagram Type |
Shape Library |
| Physical network layout |
Network Topology |
mxgraph.network |
| Cloud infrastructure (AWS) |
AWS Architecture |
mxgraph.aws4 |
| Cloud infrastructure (Azure) |
Azure Architecture |
mxgraph.azure |
| Cloud infrastructure (GCP) |
GCP Architecture |
mxgraph.gcp2 |
| Kubernetes cluster layout |
K8s Diagram |
mxgraph.kubernetes |
| Microservice communication |
Service Map |
General + custom |
| CI/CD pipeline |
Pipeline Diagram |
Flowchart + custom |
| On-prem data center |
Rack Diagram |
mxgraph.rack |
| Security zones / DMZ |
Zone Diagram |
Swimlanes + shapes |
| Hybrid cloud |
Multi-cloud |
Combined libraries |
Shape Libraries
Enabling Cloud Libraries
In draw.io: File > Open Library From > Search or enable from the left panel.
| Library |
Prefix |
Key Shapes |
| AWS 4 |
mxgraph.aws4 |
EC2, S3, RDS, Lambda, VPC, ALB, CloudFront, Route53, ECS, EKS |
| Azure |
mxgraph.azure |
VM, App Service, SQL DB, Functions, AKS, Front Door, Key Vault |
| GCP |
mxgraph.gcp2 |
Compute Engine, GKE, Cloud Run, BigQuery, Cloud SQL, Pub/Sub |
| Kubernetes |
mxgraph.kubernetes |
Pod, Service, Deployment, Ingress, ConfigMap, PVC, Node |
| Network |
mxgraph.network |
Router, switch, firewall, server, desktop, cloud, database |
| Cisco |
mxgraph.cisco19 |
Cisco-specific network hardware icons |
| Rack |
mxgraph.rack |
Server rack, UPS, patch panel, switch unit |
Network Topology
Basic LAN/WAN Topology
<mxGraphModel>
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<!-- Internet cloud -->
<mxCell id="internet" value="Internet" style="shape=mxgraph.network.cloud;fillColor=#DDEEFF;strokeColor=#6C8EBF;fontSize=14;fontStyle=1;" vertex="1" parent="1">
<mxGeometry x="300" y="20" width="120" height="70" as="geometry"/>
</mxCell>
<!-- Firewall -->
<mxCell id="fw" value="Firewall" style="shape=mxgraph.network.firewall;fillColor=#F8CECC;strokeColor=#B85450;fontSize=11;" vertex="1" parent="1">
<mxGeometry x="330" y="140" width="60" height="60" as="geometry"/>
</mxCell>
<!-- Router -->
<mxCell id="router" value="Core Router" style="shape=mxgraph.network.router;fillColor=#DAE8FC;strokeColor=#6C8EBF;fontSize=11;" vertex="1" parent="1">
<mxGeometry x="330" y="250" width="60" height="40" as="geometry"/>
</mxCell>
<!-- Switch -->
<mxCell id="sw1" value="Switch A" style="shape=mxgraph.network.switch;fillColor=#D5E8D4;strokeColor=#82B366;fontSize=11;" vertex="1" parent="1">
<mxGeometry x="160" y="340" width="60" height="30" as="geometry"/>
</mxCell>
<mxCell id="sw2" value="Switch B" style="shape=mxgraph.network.switch;fillColor=#D5E8D4;strokeColor=#82B366;fontSize=11;" vertex="1" parent="1">
<mxGeometry x="500" y="340" width="60" height="30" as="geometry"/>
</mxCell>
<!-- Servers -->
<mxCell id="srv1" value="Web Server" style="shape=mxgraph.network.server;fillColor=#DAE8FC;strokeColor=#6C8EBF;fontSize=10;" vertex="1" parent="1">
<mxGeometry x="100" y="420" width="50" height="60" as="geometry"/>
</mxCell>
<mxCell id="srv2" value="App Server" style="shape=mxgraph.network.server;fillColor=#DAE8FC;strokeColor=#6C8EBF;fontSize=10;" vertex="1" parent="1">
<mxGeometry x="220" y="420" width="50" height="60" as="geometry"/>
</mxCell>
<mxCell id="db" value="Database" style="shape=cylinder3;fillColor=#FFF2CC;strokeColor=#D6B656;fontSize=10;whiteSpace=wrap;html=1;boundedLbl=1;size=10;" vertex="1" parent="1">
<mxGeometry x="490" y="420" width="50" height="60" as="geometry"/>
</mxCell>
<!-- Connections -->
<mxCell id="c1" style="strokeColor=#666;strokeWidth=2;" edge="1" source="internet" target="fw" parent="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="c2" style="strokeColor=#666;strokeWidth=2;" edge="1" source="fw" target="router" parent="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="c3" style="strokeColor=#666;strokeWidth=2;" edge="1" source="router" target="sw1" parent="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="c4" style="strokeColor=#666;strokeWidth=2;" edge="1" source="router" target="sw2" parent="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="c5" style="strokeColor=#666;strokeWidth=1;" edge="1" source="sw1" target="srv1" parent="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="c6" style="strokeColor=#666;strokeWidth=1;" edge="1" source="sw1" target="srv2" parent="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="c7" style="strokeColor=#666;strokeWidth=1;" edge="1" source="sw2" target="db" parent="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
AWS Architecture
Three-Tier Web Application
<mxGraphModel>
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<!-- VPC boundary -->
<mxCell id="vpc" value="VPC (10.0.0.0/16)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=none;strokeColor=#248814;strokeWidth=2;dashed=1;verticalAlign=top;fontStyle=1;fontSize=13;fontColor=#248814;spacingTop=4;arcSize=4;" vertex="1" parent="1">
<mxGeometry x="80" y="100" width="640" height="440" as="geometry"/>
</mxCell>
<!-- Public subnet -->
<mxCell id="pubSub" value="Public Subnet (10.0.1.0/24)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#E8F5E9;strokeColor=#82B366;dashed=1;verticalAlign=top;fontSize=11;fontColor=#82B366;spacingTop=4;" vertex="1" parent="1">
<mxGeometry x="100" y="140" width="280" height="160" as="geometry"/>
</mxCell>
<!-- Private subnet -->
<mxCell id="privSub" value="Private Subnet (10.0.2.0/24)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF3E0;strokeColor=#D6B656;dashed=1;verticalAlign=top;fontSize=11;fontColor=#D6B656;spacingTop=4;" vertex="1" parent="1">
<mxGeometry x="420" y="140" width="280" height="160" as="geometry"/>
</mxCell>
<!-- Data subnet -->
<mxCell id="dataSub" value="Data Subnet (10.0.3.0/24)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FCE4EC;strokeColor=#B85450;dashed=1;verticalAlign=top;fontSize=11;fontColor=#B85450;spacingTop=4;" vertex="1" parent="1">
<mxGeometry x="200" y="340" width="400" height="180" as="geometry"/>
</mxCell>
<!-- CloudFront -->
<mxCell id="cf" value="CloudFront" style="shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.cloudfront;fillColor=#8C4FFF;fontColor=#333;fontSize=10;" vertex="1" parent="1">
<mxGeometry x="30" y="20" width="48" height="48" as="geometry"/>
</mxCell>
<!-- ALB -->
<mxCell id="alb" value="ALB" style="shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.elastic_load_balancing;fillColor=#8C4FFF;fontColor=#333;fontSize=10;" vertex="1" parent="1">
<mxGeometry x="140" y="180" width="48" height="48" as="geometry"/>
</mxCell>
<!-- EC2 instances -->
<mxCell id="ec2a" value="EC2" style="shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.ec2;fillColor=#ED7100;fontColor=#333;fontSize=10;" vertex="1" parent="1">
<mxGeometry x="280" y="180" width="48" height="48" as="geometry"/>
</mxCell>
<!-- Lambda -->
<mxCell id="lambda" value="Lambda" style="shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.lambda;fillColor=#ED7100;fontColor=#333;fontSize=10;" vertex="1" parent="1">
<mxGeometry x="460" y="180" width="48" height="48" as="geometry"/>
</mxCell>
<!-- RDS -->
<mxCell id="rds" value="RDS (Multi-AZ)" style="shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.rds;fillColor=#C925D1;fontColor=#333;fontSize=10;" vertex="1" parent="1">
<mxGeometry x="280" y="400" width="48" height="48" as="geometry"/>
</mxCell>
<!-- ElastiCache -->
<mxCell id="cache" value="ElastiCache" style="shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.elasticache;fillColor=#C925D1;fontColor=#333;fontSize=10;" vertex="1" parent="1">
<mxGeometry x="440" y="400" width="48" height="48" as="geometry"/>
</mxCell>
<!-- S3 -->
<mxCell id="s3" value="S3" style="shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.s3;fillColor=#3F8624;fontColor=#333;fontSize=10;" vertex="1" parent="1">
<mxGeometry x="620" y="180" width="48" height="48" as="geometry"/>
</mxCell>
<!-- Connections -->
<mxCell id="a1" style="strokeColor=#666;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="cf" target="alb" parent="1"/>
<mxCell id="a2" style="strokeColor=#666;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="alb" target="ec2a" parent="1"/>
<mxCell id="a3" style="strokeColor=#666;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="ec2a" target="lambda" parent="1"/>
<mxCell id="a4" style="strokeColor=#666;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="ec2a" target="rds" parent="1"/>
<mxCell id="a5" style="strokeColor=#666;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="lambda" target="cache" parent="1"/>
<mxCell id="a6" style="strokeColor=#666;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="lambda" target="s3" parent="1"/>
</root>
</mxGraphModel>
AWS Style Guide
| Service Category |
Icon Fill |
Examples |
| Compute |
#ED7100 (orange) |
EC2, Lambda, ECS, Fargate |
| Storage |
#3F8624 (green) |
S3, EBS, EFS |
| Database |
#C925D1 (purple) |
RDS, DynamoDB, ElastiCache |
| Networking |
#8C4FFF (violet) |
VPC, ALB, CloudFront, Route53 |
| Security |
#DD344C (red) |
IAM, WAF, Shield, KMS |
| Management |
#E7157B (pink) |
CloudWatch, CloudTrail, Config |
Azure Architecture
Key Azure Shapes
App Service: shape=mxgraph.azure.app_service;
AKS: shape=mxgraph.azure.kubernetes_services;
SQL Database: shape=mxgraph.azure.azure_sql_database;
Functions: shape=mxgraph.azure.function_apps;
Front Door: shape=mxgraph.azure.front_doors;
Key Vault: shape=mxgraph.azure.key_vaults;
Storage: shape=mxgraph.azure.storage;
Cosmos DB: shape=mxgraph.azure.azure_cosmos_db;
VNET: shape=mxgraph.azure.virtual_networks;
Azure Resource Group Pattern
<!-- Resource Group boundary -->
<mxCell id="rg" value="rg-myapp-prod" style="rounded=1;whiteSpace=wrap;html=1;fillColor=none;strokeColor=#0078D4;strokeWidth=2;dashed=1;verticalAlign=top;fontStyle=1;fontSize=12;fontColor=#0078D4;spacingTop=4;" vertex="1" parent="1">
<mxGeometry x="40" y="40" width="500" height="300" as="geometry"/>
</mxCell>
GCP Architecture
Key GCP Shapes
Compute Engine: shape=mxgraph.gcp2.compute_engine;
GKE: shape=mxgraph.gcp2.google_kubernetes_engine;
Cloud Run: shape=mxgraph.gcp2.cloud_run;
Cloud SQL: shape=mxgraph.gcp2.cloud_sql;
BigQuery: shape=mxgraph.gcp2.bigquery;
Pub/Sub: shape=mxgraph.gcp2.cloud_pubsub;
Cloud Storage: shape=mxgraph.gcp2.cloud_storage;
Cloud Functions: shape=mxgraph.gcp2.cloud_functions;
Kubernetes Cluster Diagrams
K8s Deployment Topology
<mxGraphModel>
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<!-- Cluster boundary -->
<mxCell id="cluster" value="K8s Cluster" style="rounded=1;whiteSpace=wrap;html=1;fillColor=none;strokeColor=#326CE5;strokeWidth=2;dashed=1;verticalAlign=top;fontStyle=1;fontSize=14;fontColor=#326CE5;arcSize=4;spacingTop=4;" vertex="1" parent="1">
<mxGeometry x="40" y="40" width="600" height="400" as="geometry"/>
</mxCell>
<!-- Namespace -->
<mxCell id="ns" value="namespace: production" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#EBF0F7;strokeColor=#326CE5;dashed=1;verticalAlign=top;fontSize=11;fontColor=#326CE5;spacingTop=4;" vertex="1" parent="1">
<mxGeometry x="60" y="80" width="560" height="340" as="geometry"/>
</mxCell>
<!-- Ingress -->
<mxCell id="ingress" value="Ingress" style="shape=mxgraph.kubernetes.ingress;fillColor=#326CE5;fontColor=#FFF;fontSize=10;" vertex="1" parent="1">
<mxGeometry x="80" y="120" width="48" height="48" as="geometry"/>
</mxCell>
<!-- Service -->
<mxCell id="svc" value="Service
(ClusterIP)" style="shape=mxgraph.kubernetes.svc;fillColor=#326CE5;fontColor=#FFF;fontSize=10;" vertex="1" parent="1">
<mxGeometry x="200" y="120" width="48" height="48" as="geometry"/>
</mxCell>
<!-- Deployment -->
<mxCell id="deploy" value="Deployment
(3 replicas)" style="shape=mxgraph.kubernetes.deploy;fillColor=#326CE5;fontColor=#FFF;fontSize=10;" vertex="1" parent="1">
<mxGeometry x="340" y="110" width="48" height="48" as="geometry"/>
</mxCell>
<!-- Pods -->
<mxCell id="pod1" value="Pod 1" style="shape=mxgraph.kubernetes.pod;fillColor=#326CE5;fontColor=#FFF;fontSize=9;" vertex="1" parent="1">
<mxGeometry x="440" y="100" width="40" height="40" as="geometry"/>
</mxCell>
<mxCell id="pod2" value="Pod 2" style="shape=mxgraph.kubernetes.pod;fillColor=#326CE5;fontColor=#FFF;fontSize=9;" vertex="1" parent="1">
<mxGeometry x="500" y="100" width="40" height="40" as="geometry"/>
</mxCell>
<mxCell id="pod3" value="Pod 3" style="shape=mxgraph.kubernetes.pod;fillColor=#326CE5;fontColor=#FFF;fontSize=9;" vertex="1" parent="1">
<mxGeometry x="560" y="100" width="40" height="40" as="geometry"/>
</mxCell>
<!-- ConfigMap -->
<mxCell id="cm" value="ConfigMap" style="shape=mxgraph.kubernetes.cm;fillColor=#326CE5;fontColor=#FFF;fontSize=9;" vertex="1" parent="1">
<mxGeometry x="200" y="240" width="40" height="40" as="geometry"/>
</mxCell>
<!-- Secret -->
<mxCell id="secret" value="Secret" style="shape=mxgraph.kubernetes.secret;fillColor=#326CE5;fontColor=#FFF;fontSize=9;" vertex="1" parent="1">
<mxGeometry x="300" y="240" width="40" height="40" as="geometry"/>
</mxCell>
<!-- PVC -->
<mxCell id="pvc" value="PVC" style="shape=mxgraph.kubernetes.pvc;fillColor=#326CE5;fontColor=#FFF;fontSize=9;" vertex="1" parent="1">
<mxGeometry x="400" y="240" width="40" height="40" as="geometry"/>
</mxCell>
<!-- HPA -->
<mxCell id="hpa" value="HPA" style="shape=mxgraph.kubernetes.hpa;fillColor=#326CE5;fontColor=#FFF;fontSize=9;" vertex="1" parent="1">
<mxGeometry x="340" y="180" width="40" height="40" as="geometry"/>
</mxCell>
<!-- Connections -->
<mxCell id="k1" style="strokeColor=#326CE5;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="ingress" target="svc" parent="1"/>
<mxCell id="k2" style="strokeColor=#326CE5;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="svc" target="deploy" parent="1"/>
<mxCell id="k3" style="strokeColor=#326CE5;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="deploy" target="pod1" parent="1"/>
<mxCell id="k4" style="strokeColor=#326CE5;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="deploy" target="pod2" parent="1"/>
<mxCell id="k5" style="strokeColor=#326CE5;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="deploy" target="pod3" parent="1"/>
<mxCell id="k6" style="strokeColor=#999;strokeWidth=1;dashed=1;endArrow=open;" edge="1" source="pod1" target="cm" parent="1"/>
<mxCell id="k7" style="strokeColor=#999;strokeWidth=1;dashed=1;endArrow=open;" edge="1" source="pod1" target="secret" parent="1"/>
<mxCell id="k8" style="strokeColor=#999;strokeWidth=1;dashed=1;endArrow=open;" edge="1" source="pod1" target="pvc" parent="1"/>
</root>
</mxGraphModel>
Microservice Architecture
Service Mesh Pattern
<mxGraphModel>
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<!-- API Gateway -->
<mxCell id="gw" value="<b>API Gateway</b>
Kong / Envoy" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#DAE8FC;strokeColor=#6C8EBF;fontSize=12;shadow=1;" vertex="1" parent="1">
<mxGeometry x="280" y="20" width="140" height="50" as="geometry"/>
</mxCell>
<!-- Services -->
<mxCell id="auth" value="<b>Auth Service</b>
Node.js" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#D5E8D4;strokeColor=#82B366;fontSize=11;shadow=1;" vertex="1" parent="1">
<mxGeometry x="60" y="140" width="130" height="50" as="geometry"/>
</mxCell>
<mxCell id="user" value="<b>User Service</b>
Python" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#D5E8D4;strokeColor=#82B366;fontSize=11;shadow=1;" vertex="1" parent="1">
<mxGeometry x="240" y="140" width="130" height="50" as="geometry"/>
</mxCell>
<mxCell id="order" value="<b>Order Service</b>
Go" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#D5E8D4;strokeColor=#82B366;fontSize=11;shadow=1;" vertex="1" parent="1">
<mxGeometry x="420" y="140" width="130" height="50" as="geometry"/>
</mxCell>
<mxCell id="notify" value="<b>Notification</b>
Node.js" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#D5E8D4;strokeColor=#82B366;fontSize=11;shadow=1;" vertex="1" parent="1">
<mxGeometry x="600" y="140" width="130" height="50" as="geometry"/>
</mxCell>
<!-- Message broker -->
<mxCell id="mq" value="<b>RabbitMQ</b>" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fillColor=#FFF2CC;strokeColor=#D6B656;fontSize=12;shadow=1;" vertex="1" parent="1">
<mxGeometry x="320" y="260" width="120" height="50" as="geometry"/>
</mxCell>
<!-- Databases -->
<mxCell id="authDb" value="Auth DB
(Redis)" style="shape=cylinder3;fillColor=#F8CECC;strokeColor=#B85450;fontSize=10;whiteSpace=wrap;html=1;boundedLbl=1;size=8;" vertex="1" parent="1">
<mxGeometry x="85" y="260" width="60" height="60" as="geometry"/>
</mxCell>
<mxCell id="userDb" value="User DB
(Postgres)" style="shape=cylinder3;fillColor=#F8CECC;strokeColor=#B85450;fontSize=10;whiteSpace=wrap;html=1;boundedLbl=1;size=8;" vertex="1" parent="1">
<mxGeometry x="260" y="260" width="60" height="60" as="geometry"/>
</mxCell>
<mxCell id="orderDb" value="Order DB
(MongoDB)" style="shape=cylinder3;fillColor=#F8CECC;strokeColor=#B85450;fontSize=10;whiteSpace=wrap;html=1;boundedLbl=1;size=8;" vertex="1" parent="1">
<mxGeometry x="450" y="260" width="60" height="60" as="geometry"/>
</mxCell>
<!-- Connections: gateway to services -->
<mxCell id="g1" style="strokeColor=#666;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="gw" target="auth" parent="1"/>
<mxCell id="g2" style="strokeColor=#666;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="gw" target="user" parent="1"/>
<mxCell id="g3" style="strokeColor=#666;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="gw" target="order" parent="1"/>
<!-- Async via message broker -->
<mxCell id="m1" value="events" style="strokeColor=#D6B656;strokeWidth=1;dashed=1;endArrow=open;fontSize=9;fontColor=#999;" edge="1" source="order" target="mq" parent="1"/>
<mxCell id="m2" value="events" style="strokeColor=#D6B656;strokeWidth=1;dashed=1;endArrow=open;fontSize=9;fontColor=#999;" edge="1" source="mq" target="notify" parent="1"/>
<!-- Service to DB -->
<mxCell id="d1" style="strokeColor=#B85450;strokeWidth=1;endArrow=diamond;endFill=0;" edge="1" source="auth" target="authDb" parent="1"/>
<mxCell id="d2" style="strokeColor=#B85450;strokeWidth=1;endArrow=diamond;endFill=0;" edge="1" source="user" target="userDb" parent="1"/>
<mxCell id="d3" style="strokeColor=#B85450;strokeWidth=1;endArrow=diamond;endFill=0;" edge="1" source="order" target="orderDb" parent="1"/>
</root>
</mxGraphModel>
Zone / Security Diagrams
DMZ Architecture
Use nested containers to represent security zones:
<!-- External zone -->
<mxCell id="extZone" value="External Zone (Untrusted)" style="rounded=1;fillColor=#FFEBEE;strokeColor=#B85450;strokeWidth=2;dashed=1;verticalAlign=top;fontStyle=1;fontSize=12;fontColor=#B85450;spacingTop=4;" vertex="1" parent="1">
<mxGeometry x="20" y="20" width="200" height="300" as="geometry"/>
</mxCell>
<!-- DMZ -->
<mxCell id="dmz" value="DMZ (Semi-Trusted)" style="rounded=1;fillColor=#FFF3E0;strokeColor=#D6B656;strokeWidth=2;dashed=1;verticalAlign=top;fontStyle=1;fontSize=12;fontColor=#D6B656;spacingTop=4;" vertex="1" parent="1">
<mxGeometry x="260" y="20" width="200" height="300" as="geometry"/>
</mxCell>
<!-- Internal zone -->
<mxCell id="intZone" value="Internal Zone (Trusted)" style="rounded=1;fillColor=#E8F5E9;strokeColor=#82B366;strokeWidth=2;dashed=1;verticalAlign=top;fontStyle=1;fontSize=12;fontColor=#82B366;spacingTop=4;" vertex="1" parent="1">
<mxGeometry x="500" y="20" width="200" height="300" as="geometry"/>
</mxCell>
Zone Color Convention
| Zone |
Fill |
Stroke |
Trust Level |
| External |
#FFEBEE |
#B85450 (red) |
Untrusted |
| DMZ |
#FFF3E0 |
#D6B656 (amber) |
Semi-trusted |
| Internal |
#E8F5E9 |
#82B366 (green) |
Trusted |
| Management |
#E3F2FD |
#6C8EBF (blue) |
Admin only |
Connection Style Guide
| Connection Type |
Style |
Use |
| Synchronous (HTTP/gRPC) |
strokeColor=#666;strokeWidth=2;endArrow=block;endFill=1; |
Request/response |
| Asynchronous (events) |
strokeColor=#D6B656;strokeWidth=1;dashed=1;endArrow=open; |
Pub/sub, message queues |
| Database access |
strokeColor=#B85450;strokeWidth=1;endArrow=diamond;endFill=0; |
Read/write to DB |
| Monitoring / logs |
strokeColor=#999;strokeWidth=1;dashed=1;dashPattern=4 4;endArrow=open; |
Observability |
| Bidirectional |
strokeColor=#666;strokeWidth=1;endArrow=block;startArrow=block;endFill=1;startFill=1; |
WebSocket, streaming |
Layout Best Practices
- Flow direction — Traffic flows top-to-bottom (internet at top, databases at bottom) or left-to-right
- Group by zone — Use dashed containers for VPCs, subnets, namespaces, security zones
- Color by function — Compute (blue), storage (green), database (yellow/red), network (purple)
- Label protocols — Add edge labels:
HTTPS, gRPC, AMQP, TCP/5432
- Show redundancy — Use grouped icons or
(3x) labels for replicated components
- Add a legend — Include a box in the corner explaining colors, line styles, and icon meanings
- Use layers — Separate physical, logical, and security views into draw.io layers
1---2name: network-software-mapping3description: Network topology, infrastructure architecture, and software system mapping in draw.io with cloud, on-prem, and hybrid layouts4---56# Network & Software Architecture Mapping78## Diagram Type Selection910| Need | Diagram Type | Shape Library |11|------|-------------|---------------|12| Physical network layout | Network Topology | `mxgraph.network` |13| Cloud infrastructure (AWS) | AWS Architecture | `mxgraph.aws4` |14| Cloud infrastructure (Azure) | Azure Architecture | `mxgraph.azure` |15| Cloud infrastructure (GCP) | GCP Architecture | `mxgraph.gcp2` |16| Kubernetes cluster layout | K8s Diagram | `mxgraph.kubernetes` |17| Microservice communication | Service Map | General + custom |18| CI/CD pipeline | Pipeline Diagram | Flowchart + custom |19| On-prem data center | Rack Diagram | `mxgraph.rack` |20| Security zones / DMZ | Zone Diagram | Swimlanes + shapes |21| Hybrid cloud | Multi-cloud | Combined libraries |2223---2425## Shape Libraries2627### Enabling Cloud Libraries2829In draw.io: **File > Open Library From > Search** or enable from the left panel.3031| Library | Prefix | Key Shapes |32|---------|--------|-----------|33| AWS 4 | `mxgraph.aws4` | EC2, S3, RDS, Lambda, VPC, ALB, CloudFront, Route53, ECS, EKS |34| Azure | `mxgraph.azure` | VM, App Service, SQL DB, Functions, AKS, Front Door, Key Vault |35| GCP | `mxgraph.gcp2` | Compute Engine, GKE, Cloud Run, BigQuery, Cloud SQL, Pub/Sub |36| Kubernetes | `mxgraph.kubernetes` | Pod, Service, Deployment, Ingress, ConfigMap, PVC, Node |37| Network | `mxgraph.network` | Router, switch, firewall, server, desktop, cloud, database |38| Cisco | `mxgraph.cisco19` | Cisco-specific network hardware icons |39| Rack | `mxgraph.rack` | Server rack, UPS, patch panel, switch unit |4041---4243## Network Topology4445### Basic LAN/WAN Topology4647```xml48<mxGraphModel>49 <root>50 <mxCell id="0"/>51 <mxCell id="1" parent="0"/>52 <!-- Internet cloud -->53 <mxCell id="internet" value="Internet" style="shape=mxgraph.network.cloud;fillColor=#DDEEFF;strokeColor=#6C8EBF;fontSize=14;fontStyle=1;" vertex="1" parent="1">54 <mxGeometry x="300" y="20" width="120" height="70" as="geometry"/>55 </mxCell>56 <!-- Firewall -->57 <mxCell id="fw" value="Firewall" style="shape=mxgraph.network.firewall;fillColor=#F8CECC;strokeColor=#B85450;fontSize=11;" vertex="1" parent="1">58 <mxGeometry x="330" y="140" width="60" height="60" as="geometry"/>59 </mxCell>60 <!-- Router -->61 <mxCell id="router" value="Core Router" style="shape=mxgraph.network.router;fillColor=#DAE8FC;strokeColor=#6C8EBF;fontSize=11;" vertex="1" parent="1">62 <mxGeometry x="330" y="250" width="60" height="40" as="geometry"/>63 </mxCell>64 <!-- Switch -->65 <mxCell id="sw1" value="Switch A" style="shape=mxgraph.network.switch;fillColor=#D5E8D4;strokeColor=#82B366;fontSize=11;" vertex="1" parent="1">66 <mxGeometry x="160" y="340" width="60" height="30" as="geometry"/>67 </mxCell>68 <mxCell id="sw2" value="Switch B" style="shape=mxgraph.network.switch;fillColor=#D5E8D4;strokeColor=#82B366;fontSize=11;" vertex="1" parent="1">69 <mxGeometry x="500" y="340" width="60" height="30" as="geometry"/>70 </mxCell>71 <!-- Servers -->72 <mxCell id="srv1" value="Web Server" style="shape=mxgraph.network.server;fillColor=#DAE8FC;strokeColor=#6C8EBF;fontSize=10;" vertex="1" parent="1">73 <mxGeometry x="100" y="420" width="50" height="60" as="geometry"/>74 </mxCell>75 <mxCell id="srv2" value="App Server" style="shape=mxgraph.network.server;fillColor=#DAE8FC;strokeColor=#6C8EBF;fontSize=10;" vertex="1" parent="1">76 <mxGeometry x="220" y="420" width="50" height="60" as="geometry"/>77 </mxCell>78 <mxCell id="db" value="Database" style="shape=cylinder3;fillColor=#FFF2CC;strokeColor=#D6B656;fontSize=10;whiteSpace=wrap;html=1;boundedLbl=1;size=10;" vertex="1" parent="1">79 <mxGeometry x="490" y="420" width="50" height="60" as="geometry"/>80 </mxCell>81 <!-- Connections -->82 <mxCell id="c1" style="strokeColor=#666;strokeWidth=2;" edge="1" source="internet" target="fw" parent="1">83 <mxGeometry relative="1" as="geometry"/>84 </mxCell>85 <mxCell id="c2" style="strokeColor=#666;strokeWidth=2;" edge="1" source="fw" target="router" parent="1">86 <mxGeometry relative="1" as="geometry"/>87 </mxCell>88 <mxCell id="c3" style="strokeColor=#666;strokeWidth=2;" edge="1" source="router" target="sw1" parent="1">89 <mxGeometry relative="1" as="geometry"/>90 </mxCell>91 <mxCell id="c4" style="strokeColor=#666;strokeWidth=2;" edge="1" source="router" target="sw2" parent="1">92 <mxGeometry relative="1" as="geometry"/>93 </mxCell>94 <mxCell id="c5" style="strokeColor=#666;strokeWidth=1;" edge="1" source="sw1" target="srv1" parent="1">95 <mxGeometry relative="1" as="geometry"/>96 </mxCell>97 <mxCell id="c6" style="strokeColor=#666;strokeWidth=1;" edge="1" source="sw1" target="srv2" parent="1">98 <mxGeometry relative="1" as="geometry"/>99 </mxCell>100 <mxCell id="c7" style="strokeColor=#666;strokeWidth=1;" edge="1" source="sw2" target="db" parent="1">101 <mxGeometry relative="1" as="geometry"/>102 </mxCell>103 </root>104</mxGraphModel>105```106107---108109## AWS Architecture110111### Three-Tier Web Application112113```xml114<mxGraphModel>115 <root>116 <mxCell id="0"/>117 <mxCell id="1" parent="0"/>118 <!-- VPC boundary -->119 <mxCell id="vpc" value="VPC (10.0.0.0/16)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=none;strokeColor=#248814;strokeWidth=2;dashed=1;verticalAlign=top;fontStyle=1;fontSize=13;fontColor=#248814;spacingTop=4;arcSize=4;" vertex="1" parent="1">120 <mxGeometry x="80" y="100" width="640" height="440" as="geometry"/>121 </mxCell>122 <!-- Public subnet -->123 <mxCell id="pubSub" value="Public Subnet (10.0.1.0/24)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#E8F5E9;strokeColor=#82B366;dashed=1;verticalAlign=top;fontSize=11;fontColor=#82B366;spacingTop=4;" vertex="1" parent="1">124 <mxGeometry x="100" y="140" width="280" height="160" as="geometry"/>125 </mxCell>126 <!-- Private subnet -->127 <mxCell id="privSub" value="Private Subnet (10.0.2.0/24)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF3E0;strokeColor=#D6B656;dashed=1;verticalAlign=top;fontSize=11;fontColor=#D6B656;spacingTop=4;" vertex="1" parent="1">128 <mxGeometry x="420" y="140" width="280" height="160" as="geometry"/>129 </mxCell>130 <!-- Data subnet -->131 <mxCell id="dataSub" value="Data Subnet (10.0.3.0/24)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FCE4EC;strokeColor=#B85450;dashed=1;verticalAlign=top;fontSize=11;fontColor=#B85450;spacingTop=4;" vertex="1" parent="1">132 <mxGeometry x="200" y="340" width="400" height="180" as="geometry"/>133 </mxCell>134 <!-- CloudFront -->135 <mxCell id="cf" value="CloudFront" style="shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.cloudfront;fillColor=#8C4FFF;fontColor=#333;fontSize=10;" vertex="1" parent="1">136 <mxGeometry x="30" y="20" width="48" height="48" as="geometry"/>137 </mxCell>138 <!-- ALB -->139 <mxCell id="alb" value="ALB" style="shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.elastic_load_balancing;fillColor=#8C4FFF;fontColor=#333;fontSize=10;" vertex="1" parent="1">140 <mxGeometry x="140" y="180" width="48" height="48" as="geometry"/>141 </mxCell>142 <!-- EC2 instances -->143 <mxCell id="ec2a" value="EC2" style="shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.ec2;fillColor=#ED7100;fontColor=#333;fontSize=10;" vertex="1" parent="1">144 <mxGeometry x="280" y="180" width="48" height="48" as="geometry"/>145 </mxCell>146 <!-- Lambda -->147 <mxCell id="lambda" value="Lambda" style="shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.lambda;fillColor=#ED7100;fontColor=#333;fontSize=10;" vertex="1" parent="1">148 <mxGeometry x="460" y="180" width="48" height="48" as="geometry"/>149 </mxCell>150 <!-- RDS -->151 <mxCell id="rds" value="RDS (Multi-AZ)" style="shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.rds;fillColor=#C925D1;fontColor=#333;fontSize=10;" vertex="1" parent="1">152 <mxGeometry x="280" y="400" width="48" height="48" as="geometry"/>153 </mxCell>154 <!-- ElastiCache -->155 <mxCell id="cache" value="ElastiCache" style="shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.elasticache;fillColor=#C925D1;fontColor=#333;fontSize=10;" vertex="1" parent="1">156 <mxGeometry x="440" y="400" width="48" height="48" as="geometry"/>157 </mxCell>158 <!-- S3 -->159 <mxCell id="s3" value="S3" style="shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.s3;fillColor=#3F8624;fontColor=#333;fontSize=10;" vertex="1" parent="1">160 <mxGeometry x="620" y="180" width="48" height="48" as="geometry"/>161 </mxCell>162 <!-- Connections -->163 <mxCell id="a1" style="strokeColor=#666;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="cf" target="alb" parent="1"/>164 <mxCell id="a2" style="strokeColor=#666;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="alb" target="ec2a" parent="1"/>165 <mxCell id="a3" style="strokeColor=#666;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="ec2a" target="lambda" parent="1"/>166 <mxCell id="a4" style="strokeColor=#666;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="ec2a" target="rds" parent="1"/>167 <mxCell id="a5" style="strokeColor=#666;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="lambda" target="cache" parent="1"/>168 <mxCell id="a6" style="strokeColor=#666;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="lambda" target="s3" parent="1"/>169 </root>170</mxGraphModel>171```172173### AWS Style Guide174175| Service Category | Icon Fill | Examples |176|-----------------|-----------|----------|177| Compute | `#ED7100` (orange) | EC2, Lambda, ECS, Fargate |178| Storage | `#3F8624` (green) | S3, EBS, EFS |179| Database | `#C925D1` (purple) | RDS, DynamoDB, ElastiCache |180| Networking | `#8C4FFF` (violet) | VPC, ALB, CloudFront, Route53 |181| Security | `#DD344C` (red) | IAM, WAF, Shield, KMS |182| Management | `#E7157B` (pink) | CloudWatch, CloudTrail, Config |183184---185186## Azure Architecture187188### Key Azure Shapes189190```191App Service: shape=mxgraph.azure.app_service;192AKS: shape=mxgraph.azure.kubernetes_services;193SQL Database: shape=mxgraph.azure.azure_sql_database;194Functions: shape=mxgraph.azure.function_apps;195Front Door: shape=mxgraph.azure.front_doors;196Key Vault: shape=mxgraph.azure.key_vaults;197Storage: shape=mxgraph.azure.storage;198Cosmos DB: shape=mxgraph.azure.azure_cosmos_db;199VNET: shape=mxgraph.azure.virtual_networks;200```201202### Azure Resource Group Pattern203204```xml205<!-- Resource Group boundary -->206<mxCell id="rg" value="rg-myapp-prod" style="rounded=1;whiteSpace=wrap;html=1;fillColor=none;strokeColor=#0078D4;strokeWidth=2;dashed=1;verticalAlign=top;fontStyle=1;fontSize=12;fontColor=#0078D4;spacingTop=4;" vertex="1" parent="1">207 <mxGeometry x="40" y="40" width="500" height="300" as="geometry"/>208</mxCell>209```210211---212213## GCP Architecture214215### Key GCP Shapes216217```218Compute Engine: shape=mxgraph.gcp2.compute_engine;219GKE: shape=mxgraph.gcp2.google_kubernetes_engine;220Cloud Run: shape=mxgraph.gcp2.cloud_run;221Cloud SQL: shape=mxgraph.gcp2.cloud_sql;222BigQuery: shape=mxgraph.gcp2.bigquery;223Pub/Sub: shape=mxgraph.gcp2.cloud_pubsub;224Cloud Storage: shape=mxgraph.gcp2.cloud_storage;225Cloud Functions: shape=mxgraph.gcp2.cloud_functions;226```227228---229230## Kubernetes Cluster Diagrams231232### K8s Deployment Topology233234```xml235<mxGraphModel>236 <root>237 <mxCell id="0"/>238 <mxCell id="1" parent="0"/>239 <!-- Cluster boundary -->240 <mxCell id="cluster" value="K8s Cluster" style="rounded=1;whiteSpace=wrap;html=1;fillColor=none;strokeColor=#326CE5;strokeWidth=2;dashed=1;verticalAlign=top;fontStyle=1;fontSize=14;fontColor=#326CE5;arcSize=4;spacingTop=4;" vertex="1" parent="1">241 <mxGeometry x="40" y="40" width="600" height="400" as="geometry"/>242 </mxCell>243 <!-- Namespace -->244 <mxCell id="ns" value="namespace: production" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#EBF0F7;strokeColor=#326CE5;dashed=1;verticalAlign=top;fontSize=11;fontColor=#326CE5;spacingTop=4;" vertex="1" parent="1">245 <mxGeometry x="60" y="80" width="560" height="340" as="geometry"/>246 </mxCell>247 <!-- Ingress -->248 <mxCell id="ingress" value="Ingress" style="shape=mxgraph.kubernetes.ingress;fillColor=#326CE5;fontColor=#FFF;fontSize=10;" vertex="1" parent="1">249 <mxGeometry x="80" y="120" width="48" height="48" as="geometry"/>250 </mxCell>251 <!-- Service -->252 <mxCell id="svc" value="Service
(ClusterIP)" style="shape=mxgraph.kubernetes.svc;fillColor=#326CE5;fontColor=#FFF;fontSize=10;" vertex="1" parent="1">253 <mxGeometry x="200" y="120" width="48" height="48" as="geometry"/>254 </mxCell>255 <!-- Deployment -->256 <mxCell id="deploy" value="Deployment
(3 replicas)" style="shape=mxgraph.kubernetes.deploy;fillColor=#326CE5;fontColor=#FFF;fontSize=10;" vertex="1" parent="1">257 <mxGeometry x="340" y="110" width="48" height="48" as="geometry"/>258 </mxCell>259 <!-- Pods -->260 <mxCell id="pod1" value="Pod 1" style="shape=mxgraph.kubernetes.pod;fillColor=#326CE5;fontColor=#FFF;fontSize=9;" vertex="1" parent="1">261 <mxGeometry x="440" y="100" width="40" height="40" as="geometry"/>262 </mxCell>263 <mxCell id="pod2" value="Pod 2" style="shape=mxgraph.kubernetes.pod;fillColor=#326CE5;fontColor=#FFF;fontSize=9;" vertex="1" parent="1">264 <mxGeometry x="500" y="100" width="40" height="40" as="geometry"/>265 </mxCell>266 <mxCell id="pod3" value="Pod 3" style="shape=mxgraph.kubernetes.pod;fillColor=#326CE5;fontColor=#FFF;fontSize=9;" vertex="1" parent="1">267 <mxGeometry x="560" y="100" width="40" height="40" as="geometry"/>268 </mxCell>269 <!-- ConfigMap -->270 <mxCell id="cm" value="ConfigMap" style="shape=mxgraph.kubernetes.cm;fillColor=#326CE5;fontColor=#FFF;fontSize=9;" vertex="1" parent="1">271 <mxGeometry x="200" y="240" width="40" height="40" as="geometry"/>272 </mxCell>273 <!-- Secret -->274 <mxCell id="secret" value="Secret" style="shape=mxgraph.kubernetes.secret;fillColor=#326CE5;fontColor=#FFF;fontSize=9;" vertex="1" parent="1">275 <mxGeometry x="300" y="240" width="40" height="40" as="geometry"/>276 </mxCell>277 <!-- PVC -->278 <mxCell id="pvc" value="PVC" style="shape=mxgraph.kubernetes.pvc;fillColor=#326CE5;fontColor=#FFF;fontSize=9;" vertex="1" parent="1">279 <mxGeometry x="400" y="240" width="40" height="40" as="geometry"/>280 </mxCell>281 <!-- HPA -->282 <mxCell id="hpa" value="HPA" style="shape=mxgraph.kubernetes.hpa;fillColor=#326CE5;fontColor=#FFF;fontSize=9;" vertex="1" parent="1">283 <mxGeometry x="340" y="180" width="40" height="40" as="geometry"/>284 </mxCell>285 <!-- Connections -->286 <mxCell id="k1" style="strokeColor=#326CE5;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="ingress" target="svc" parent="1"/>287 <mxCell id="k2" style="strokeColor=#326CE5;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="svc" target="deploy" parent="1"/>288 <mxCell id="k3" style="strokeColor=#326CE5;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="deploy" target="pod1" parent="1"/>289 <mxCell id="k4" style="strokeColor=#326CE5;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="deploy" target="pod2" parent="1"/>290 <mxCell id="k5" style="strokeColor=#326CE5;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="deploy" target="pod3" parent="1"/>291 <mxCell id="k6" style="strokeColor=#999;strokeWidth=1;dashed=1;endArrow=open;" edge="1" source="pod1" target="cm" parent="1"/>292 <mxCell id="k7" style="strokeColor=#999;strokeWidth=1;dashed=1;endArrow=open;" edge="1" source="pod1" target="secret" parent="1"/>293 <mxCell id="k8" style="strokeColor=#999;strokeWidth=1;dashed=1;endArrow=open;" edge="1" source="pod1" target="pvc" parent="1"/>294 </root>295</mxGraphModel>296```297298---299300## Microservice Architecture301302### Service Mesh Pattern303304```xml305<mxGraphModel>306 <root>307 <mxCell id="0"/>308 <mxCell id="1" parent="0"/>309 <!-- API Gateway -->310 <mxCell id="gw" value="<b>API Gateway</b>
Kong / Envoy" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#DAE8FC;strokeColor=#6C8EBF;fontSize=12;shadow=1;" vertex="1" parent="1">311 <mxGeometry x="280" y="20" width="140" height="50" as="geometry"/>312 </mxCell>313 <!-- Services -->314 <mxCell id="auth" value="<b>Auth Service</b>
Node.js" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#D5E8D4;strokeColor=#82B366;fontSize=11;shadow=1;" vertex="1" parent="1">315 <mxGeometry x="60" y="140" width="130" height="50" as="geometry"/>316 </mxCell>317 <mxCell id="user" value="<b>User Service</b>
Python" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#D5E8D4;strokeColor=#82B366;fontSize=11;shadow=1;" vertex="1" parent="1">318 <mxGeometry x="240" y="140" width="130" height="50" as="geometry"/>319 </mxCell>320 <mxCell id="order" value="<b>Order Service</b>
Go" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#D5E8D4;strokeColor=#82B366;fontSize=11;shadow=1;" vertex="1" parent="1">321 <mxGeometry x="420" y="140" width="130" height="50" as="geometry"/>322 </mxCell>323 <mxCell id="notify" value="<b>Notification</b>
Node.js" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#D5E8D4;strokeColor=#82B366;fontSize=11;shadow=1;" vertex="1" parent="1">324 <mxGeometry x="600" y="140" width="130" height="50" as="geometry"/>325 </mxCell>326 <!-- Message broker -->327 <mxCell id="mq" value="<b>RabbitMQ</b>" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fillColor=#FFF2CC;strokeColor=#D6B656;fontSize=12;shadow=1;" vertex="1" parent="1">328 <mxGeometry x="320" y="260" width="120" height="50" as="geometry"/>329 </mxCell>330 <!-- Databases -->331 <mxCell id="authDb" value="Auth DB
(Redis)" style="shape=cylinder3;fillColor=#F8CECC;strokeColor=#B85450;fontSize=10;whiteSpace=wrap;html=1;boundedLbl=1;size=8;" vertex="1" parent="1">332 <mxGeometry x="85" y="260" width="60" height="60" as="geometry"/>333 </mxCell>334 <mxCell id="userDb" value="User DB
(Postgres)" style="shape=cylinder3;fillColor=#F8CECC;strokeColor=#B85450;fontSize=10;whiteSpace=wrap;html=1;boundedLbl=1;size=8;" vertex="1" parent="1">335 <mxGeometry x="260" y="260" width="60" height="60" as="geometry"/>336 </mxCell>337 <mxCell id="orderDb" value="Order DB
(MongoDB)" style="shape=cylinder3;fillColor=#F8CECC;strokeColor=#B85450;fontSize=10;whiteSpace=wrap;html=1;boundedLbl=1;size=8;" vertex="1" parent="1">338 <mxGeometry x="450" y="260" width="60" height="60" as="geometry"/>339 </mxCell>340 <!-- Connections: gateway to services -->341 <mxCell id="g1" style="strokeColor=#666;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="gw" target="auth" parent="1"/>342 <mxCell id="g2" style="strokeColor=#666;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="gw" target="user" parent="1"/>343 <mxCell id="g3" style="strokeColor=#666;strokeWidth=1;endArrow=block;endFill=1;" edge="1" source="gw" target="order" parent="1"/>344 <!-- Async via message broker -->345 <mxCell id="m1" value="events" style="strokeColor=#D6B656;strokeWidth=1;dashed=1;endArrow=open;fontSize=9;fontColor=#999;" edge="1" source="order" target="mq" parent="1"/>346 <mxCell id="m2" value="events" style="strokeColor=#D6B656;strokeWidth=1;dashed=1;endArrow=open;fontSize=9;fontColor=#999;" edge="1" source="mq" target="notify" parent="1"/>347 <!-- Service to DB -->348 <mxCell id="d1" style="strokeColor=#B85450;strokeWidth=1;endArrow=diamond;endFill=0;" edge="1" source="auth" target="authDb" parent="1"/>349 <mxCell id="d2" style="strokeColor=#B85450;strokeWidth=1;endArrow=diamond;endFill=0;" edge="1" source="user" target="userDb" parent="1"/>350 <mxCell id="d3" style="strokeColor=#B85450;strokeWidth=1;endArrow=diamond;endFill=0;" edge="1" source="order" target="orderDb" parent="1"/>351 </root>352</mxGraphModel>353```354355---356357## Zone / Security Diagrams358359### DMZ Architecture360361Use nested containers to represent security zones:362363```xml364<!-- External zone -->365<mxCell id="extZone" value="External Zone (Untrusted)" style="rounded=1;fillColor=#FFEBEE;strokeColor=#B85450;strokeWidth=2;dashed=1;verticalAlign=top;fontStyle=1;fontSize=12;fontColor=#B85450;spacingTop=4;" vertex="1" parent="1">366 <mxGeometry x="20" y="20" width="200" height="300" as="geometry"/>367</mxCell>368<!-- DMZ -->369<mxCell id="dmz" value="DMZ (Semi-Trusted)" style="rounded=1;fillColor=#FFF3E0;strokeColor=#D6B656;strokeWidth=2;dashed=1;verticalAlign=top;fontStyle=1;fontSize=12;fontColor=#D6B656;spacingTop=4;" vertex="1" parent="1">370 <mxGeometry x="260" y="20" width="200" height="300" as="geometry"/>371</mxCell>372<!-- Internal zone -->373<mxCell id="intZone" value="Internal Zone (Trusted)" style="rounded=1;fillColor=#E8F5E9;strokeColor=#82B366;strokeWidth=2;dashed=1;verticalAlign=top;fontStyle=1;fontSize=12;fontColor=#82B366;spacingTop=4;" vertex="1" parent="1">374 <mxGeometry x="500" y="20" width="200" height="300" as="geometry"/>375</mxCell>376```377378### Zone Color Convention379380| Zone | Fill | Stroke | Trust Level |381|------|------|--------|-------------|382| External | `#FFEBEE` | `#B85450` (red) | Untrusted |383| DMZ | `#FFF3E0` | `#D6B656` (amber) | Semi-trusted |384| Internal | `#E8F5E9` | `#82B366` (green) | Trusted |385| Management | `#E3F2FD` | `#6C8EBF` (blue) | Admin only |386387---388389## Connection Style Guide390391| Connection Type | Style | Use |392|----------------|-------|-----|393| Synchronous (HTTP/gRPC) | `strokeColor=#666;strokeWidth=2;endArrow=block;endFill=1;` | Request/response |394| Asynchronous (events) | `strokeColor=#D6B656;strokeWidth=1;dashed=1;endArrow=open;` | Pub/sub, message queues |395| Database access | `strokeColor=#B85450;strokeWidth=1;endArrow=diamond;endFill=0;` | Read/write to DB |396| Monitoring / logs | `strokeColor=#999;strokeWidth=1;dashed=1;dashPattern=4 4;endArrow=open;` | Observability |397| Bidirectional | `strokeColor=#666;strokeWidth=1;endArrow=block;startArrow=block;endFill=1;startFill=1;` | WebSocket, streaming |398399---400401## Layout Best Practices4024031. **Flow direction** — Traffic flows top-to-bottom (internet at top, databases at bottom) or left-to-right4042. **Group by zone** — Use dashed containers for VPCs, subnets, namespaces, security zones4053. **Color by function** — Compute (blue), storage (green), database (yellow/red), network (purple)4064. **Label protocols** — Add edge labels: `HTTPS`, `gRPC`, `AMQP`, `TCP/5432`4075. **Show redundancy** — Use grouped icons or `(3x)` labels for replicated components4086. **Add a legend** — Include a box in the corner explaining colors, line styles, and icon meanings4097. **Use layers** — Separate physical, logical, and security views into draw.io layers