The Big Picture mermaid

This commit is contained in:
2026-03-13 20:57:08 +07:00
parent 8a5eef6b13
commit 824468336d

View File

@@ -22,42 +22,49 @@ This walkthrough serves as the primary onboarding guide for new developers and e
NATSBridge implements the **Claim-Check pattern** for efficient handling of large payloads (>0.5MB): NATSBridge implements the **Claim-Check pattern** for efficient handling of large payloads (>0.5MB):
``` ```mermaid
┌─────────────────────────────────────────────────────────────────────┐ flowchart TD
│ NATSBridge Architecture │ subgraph "Sender Application"
├─────────────────────────────────────────────────────────────────────┤ A1[User Code]
│ │ A2[smartsend Function]
│ ┌──────────────┐ ┌──────────────┐ │ A3[Serialize Data]
Sender │ │ Receiver │ │ A4[Transport Selection]
│ │ │ │ │ │ A5[Publish to NATS]
│ │ ┌──────────┐ │ │ ┌──────────┐ │ │ A6[File Server Upload]
│ │smartsend │◀─────────┤ │smartreceive│ │ │ end
│ │ └────┬─────┘ │ │ └────┬─────┘ │ │
│ │ │ │ │ │ │ │ subgraph "NATS Broker"
│ │ ▼ │ │ ▼ │ │ B1[NATS Server]
│ ┌──────────┐ │ │ ┌──────────┐ │ │ end
│ │ │Serialize │◀─────────┤ │Deserialize│ │ │
│ └────┬─────┘ │ │ └────┬─────┘ │ │ subgraph "Receiver Application"
│ │ │ │ │ │ │ │ C1[Subscribe to NATS]
▼ │ │ ▼ │ │ C2[smartreceive Function]
│ │ ┌──────────┐ │ │ ┌──────────┐ │ │ C3[Deserialize Data]
│ │Transport │◀─────────┤ │Transport │ │ │ C4[Transport Selection]
│ │Selection │ │ │ │Selection │ │ │ C5[Fetch from File Server]
│ └────┬─────┘ │ │ └────┬─────┘ │ │ end
│ │ │ │ │ │ │ │
│ │ ▼ │ │ ▼ │ │ A1 --> A2
│ │ ┌──────────┐ │ │ ┌──────────┐ │ │ A2 --> A3
│ │ NATS │◀─────────┤ │ NATS │ │ │ A3 --> A4
│ │ │Publish │ │ │ │Subscribe │ │ │ A4 -->|Direct| A5
│ └──────────┘ │ │ └──────────┘ │ │ A4 -->|Link| A6
│ │ │ │ │ │ A6 --> A5
│ │ ┌──────────┐ │ │ ┌──────────┐ │ │ A5 --> B1
│ │File Server│◀─────────┤ │File Server│ │ │ B1 --> C1
│ │ │Upload │ │ │ │Download │ │ │ C1 --> C2
│ │ └──────────┘ │ │ └──────────┘ │ │ C2 --> C3
│ └──────────────┘ └──────────────┘ │ C2 --> C4
│ │ C4 -->|Fetch| C5
└─────────────────────────────────────────────────────────────────────┘ C5 --> C3
C3 --> C4
style A1 fill:#e8f5e9,stroke:#4caf50
style B1 fill:#fff3e0,stroke:#f57c00
style C1 fill:#e3f2fd,stroke:#2196f3
style A6 fill:#fef3c7,stroke:#f59e0b
style C5 fill:#fef3c7,stroke:#f59e0b
``` ```
### Key Design Principles ### Key Design Principles