Generic Diagram
Build arbitrary architecture, cloud, and system topology graphs without UML-specific ceremony using rich geometric shapes and groups.
| 1 | // Canonical Generic Diagram Reference Architecture (RFC-021) |
| 2 | // Dialect-free core diagram: no 'dialect uml;' needed! |
| 3 | diagram "Real-Time Telemetry & Analytics Platform" { |
| 4 | |
| 5 | schema { |
| 6 | // Design tokens for reusable port docking |
| 7 | let BUS_TX = [dock: "right"]; |
| 8 | let BUS_RX = [dock: "left"]; |
| 9 | |
| 10 | // 1. External Ingestion Layer (Default 'box' shape) |
| 11 | node @EdgeGateway [label: "Edge API Gateway"] { |
| 12 | port in @in_http [dock: "left", label: "HTTPS 443"]; |
| 13 | port out @out_event [dock: "right", label: "Event Stream"]; |
| 14 | } |
| 15 | |
| 16 | // 2. High-Throughput Ingestion Bus |
| 17 | node cylinder @KafkaCluster [label: "Apache Kafka Ingestion Cluster"] { |
| 18 | port in @rx_telemetry [...BUS_RX, label: "Partition 0..31"]; |
| 19 | port out @tx_stream [...BUS_TX, label: "Cleaned Stream"]; |
| 20 | port out @tx_audit [dock: "bottom", label: "Cold Archive"]; |
| 21 | } |
| 22 | |
| 23 | // 3. Internal Cloud VPC (Microservices Processing) |
| 24 | group @compute_vpc [label: "Core Processing VPC", modifier: "VPC"] { |
| 25 | node rounded @StreamProcessor [label: "Flink Stream Processor"] { |
| 26 | port in @rx_events [dock: "left"]; |
| 27 | port out @tx_enriched [dock: "right"]; |
| 28 | port out @tx_alert [dock: "top"]; |
| 29 | port out @tx_dlq [dock: "bottom"]; |
| 30 | } |
| 31 | |
| 32 | node @EnrichmentService [label: "ML Enrichment Engine"] { |
| 33 | port in @rx_raw [dock: "left"]; |
| 34 | port out @tx_clean [dock: "right"]; |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | // 4. Persistence Tier |
| 39 | node pill @OperationalDB [label: "TimescaleDB Operational State"] { |
| 40 | port in @rx_write [dock: "left"]; |
| 41 | port out @tx_replica [dock: "bottom"]; |
| 42 | } |
| 43 | |
| 44 | node cloud @ColdStorage [label: "AWS S3 Cold Parquet Lake"] { |
| 45 | port in @rx_bulk [dock: "top"]; |
| 46 | } |
| 47 | |
| 48 | // 5. Downstream Satellite Alerting & Dead-Letter |
| 49 | node hexagon @PagerDuty [label: "PagerDuty Incident Gateway"] { |
| 50 | port in @rx_trigger [dock: "bottom"]; |
| 51 | } |
| 52 | |
| 53 | node diamond @DeadLetter [label: "Dead Letter Dead-Drop"] { |
| 54 | port in @rx_quarantine [dock: "top"]; |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | flow { |
| 59 | // Ingestion & Event Distribution |
| 60 | EdgeGateway.out_event -> KafkaCluster.rx_telemetry; |
| 61 | KafkaCluster.tx_stream -> compute_vpc.StreamProcessor.rx_events; |
| 62 | |
| 63 | // Microservices Interconnect inside VPC |
| 64 | compute_vpc.StreamProcessor.tx_enriched -> compute_vpc.EnrichmentService.rx_raw; |
| 65 | compute_vpc.EnrichmentService.tx_clean -> OperationalDB.rx_write; |
| 66 | |
| 67 | // Satellite & Boundary Dispatches |
| 68 | compute_vpc.StreamProcessor.tx_alert -> PagerDuty.rx_trigger; |
| 69 | compute_vpc.StreamProcessor.tx_dlq -> DeadLetter.rx_quarantine; |
| 70 | KafkaCluster.tx_audit -> ColdStorage.rx_bulk; |
| 71 | OperationalDB.tx_replica -> ColdStorage.rx_bulk; |
| 72 | } |
| 73 | } |
| 74 | |
Errors: 0 | generic-diagram
Core Syntax Reference
| Construct | Purpose |
|---|---|
diagram "Title" { ... } | Dialect-free top-level diagram declaration |
node @Id [shape: cylinder|cloud|hexagon|rounded]; | Customize node geometry with attribute bags |
group @Vpc [label: "..."] { ... } | Nest nodes inside labeled visual boundaries |
A -> B: "stream"; | Orthogonal routed connections between nodes or ports |