Skip to content

Instantly share code, notes, and snippets.

@angusdev
Last active December 18, 2025 22:28
Show Gist options
  • Select an option

  • Save angusdev/25bf8d102d8c2fc6ca44e7136565a88f to your computer and use it in GitHub Desktop.

Select an option

Save angusdev/25bf8d102d8c2fc6ca44e7136565a88f to your computer and use it in GitHub Desktop.
sequenceDiagram
participant Client
participant API
participant Blob as Blob (XYZ Data)
participant DB as DB
participant Worker as Background Worker (AKS)
participant Cache as Blob (SQL Cache)
participant SourceDB as Source Database
Client->>API: Request (XYZ, fromDate, toData)
API->>Blob: Check XYZ data exists
alt XYZ data exists (for both dates)
Blob-->>API: XYZ data
API->>API: Process result
API-->>Client: status=success, data={}
else XYZ data not exist
Blob-->>API: No XYZ data
API->>DB: Insert queue record (XYZ,fromDate,toDate)
API-->>Client: status=pending, requestId=xxx
Worker->>DB: Read queue record
Worker->>Cache: Check SQL Cache exists
Cache-->>Worker: SQL Cache
Worker->>SourceDB: Query Peter data (SQL Cache not exists)
SourceDB-->>Worker: Peter result
Worker->>Cache: Write SQL Cache
Worker->>Worker: Process XYZ Data
Worker->>Blob: Write XYZ Data
Client->>API: requestId=xxx
API->>DB: get request detail
DB-->>API: request detail
API->>Blob: Check XYZ data exists
Blob-->>API: XYZ data
API->>API: Process result
API-->>Client: status=success, data={}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment