big picture mermaid
This commit is contained in:
@@ -22,43 +22,60 @@ 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 TB
|
||||||
|
subgraph NATSBridge["NATSBridge Module"]
|
||||||
|
direction TB
|
||||||
|
|
||||||
|
subgraph Sender["Sender (smartsend)"]
|
||||||
|
direction LR
|
||||||
|
S1["Data Tuples<br/>[(dataname, data, type)]"]
|
||||||
|
S2["Serialize Data"]
|
||||||
|
S3["Size Check"]
|
||||||
|
S4["Transport Selection"]
|
||||||
|
S5["Build Envelope"]
|
||||||
|
S6["Publish to NATS"]
|
||||||
|
|
||||||
|
S1 --> S2
|
||||||
|
S2 --> S3
|
||||||
|
S3 --> S4
|
||||||
|
S4 --> S5
|
||||||
|
S5 --> S6
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph Receiver["Receiver (smartreceive)"]
|
||||||
|
direction LR
|
||||||
|
R1["Subscribe to NATS"]
|
||||||
|
R2["Parse Envelope"]
|
||||||
|
R3["Check Transport"]
|
||||||
|
R4["Deserialize Data"]
|
||||||
|
R5["Return Payloads"]
|
||||||
|
|
||||||
|
R1 --> R2
|
||||||
|
R2 --> R3
|
||||||
|
R3 --> R4
|
||||||
|
R4 --> R5
|
||||||
|
end
|
||||||
|
|
||||||
|
S6 -.->|Message| R1
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph FileServer["HTTP File Server (Plik)"]
|
||||||
|
direction TB
|
||||||
|
FS1["Upload URL"]
|
||||||
|
FS2["Download URL"]
|
||||||
|
|
||||||
|
S4 -.->|Large Payload| FS1
|
||||||
|
R3 -.->|Fetch URL| FS2
|
||||||
|
end
|
||||||
|
|
||||||
|
style NATSBridge fill:#e1f5fe,stroke:#0288d1,stroke-width:2px
|
||||||
|
style Sender fill:#b3e5fc,stroke:#0288d1
|
||||||
|
style Receiver fill:#b3e5fc,stroke:#0288d1
|
||||||
|
style FileServer fill:#ffe0b2,stroke:#f57c00
|
||||||
```
|
```
|
||||||
┌─────────────────────────────────────────────────────────────────────┐
|
|
||||||
│ NATSBridge Architecture │
|
### Key Design Principles
|
||||||
├─────────────────────────────────────────────────────────────────────┤
|
|
||||||
│ │
|
|
||||||
│ ┌──────────────┐ ┌──────────────┐ │
|
|
||||||
│ │ Sender │ │ Receiver │ │
|
|
||||||
│ │ │ │ │ │
|
|
||||||
│ │ ┌──────────┐ │ │ ┌──────────┐ │ │
|
|
||||||
│ │ │smartsend │◀─────────┤ │smartreceive│ │ │
|
|
||||||
│ │ └────┬─────┘ │ │ └────┬─────┘ │ │
|
|
||||||
│ │ │ │ │ │ │ │
|
|
||||||
│ │ ▼ │ │ ▼ │ │
|
|
||||||
│ │ ┌──────────┐ │ │ ┌──────────┐ │ │
|
|
||||||
│ │ │Serialize │◀─────────┤ │Deserialize│ │ │
|
|
||||||
│ │ └────┬─────┘ │ │ └────┬─────┘ │ │
|
|
||||||
│ │ │ │ │ │ │ │
|
|
||||||
│ │ ▼ │ │ ▼ │ │
|
|
||||||
│ │ ┌──────────┐ │ │ ┌──────────┐ │ │
|
|
||||||
│ │ │Transport │◀─────────┤ │Transport │ │ │
|
|
||||||
│ │ │Selection │ │ │ │Selection │ │ │
|
|
||||||
│ │ └────┬─────┘ │ │ └────┬─────┘ │ │
|
|
||||||
│ │ │ │ │ │ │ │
|
|
||||||
│ │ ▼ │ │ ▼ │ │
|
|
||||||
│ │ ┌──────────┐ │ │ ┌──────────┐ │ │
|
|
||||||
│ │ │ NATS │◀─────────┤ │ NATS │ │ │
|
|
||||||
│ │ │Publish │ │ │ │Subscribe │ │ │
|
|
||||||
│ │ └──────────┘ │ │ └──────────┘ │ │
|
|
||||||
│ │ │ │ │ │
|
|
||||||
│ │ ┌──────────┐ │ │ ┌──────────┐ │ │
|
|
||||||
│ │ │File Server│◀─────────┤ │File Server│ │ │
|
|
||||||
│ │ │Upload │ │ │ │Download │ │ │
|
|
||||||
│ │ └──────────┘ │ │ └──────────┘ │ │
|
|
||||||
│ └──────────────┘ └──────────────┘ │
|
|
||||||
│ │
|
|
||||||
└─────────────────────────────────────────────────────────────────────┘
|
|
||||||
```
|
|
||||||
|
|
||||||
### Key Design Principles
|
### Key Design Principles
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user