aspire-samples icon indicating copy to clipboard operation
aspire-samples copied to clipboard

Example: Http/Grpc Api Versioning 1️⃣2️⃣3️⃣

Open josephaw1022 opened this issue 1 year ago • 0 comments

Since api versioning is a best practice in a microservice architecture. I think showing an example with http and grpc with two different versions and having them two client services that utilize different versions of the api's would be beneficial for versioning guidance.

graph LR
    subgraph Web UI 1
    A[Web UI 1]
    end

    subgraph Web UI 2
    B[Web UI 2]
    end

    subgraph gRPC Applications
    GRPC1[gRPC App V1]
    GRPC2[gRPC App V2]
    end

    subgraph HTTP Applications
    HTTP1[HTTP App V2]
    HTTP2[HTTP App V3]
    end

    A -->|communicates with| GRPC1
    A -->|communicates with| HTTP1
    B -->|communicates with| GRPC2
    B -->|communicates with| HTTP2

We can also utilize an api gateway to have it automatically redirect from v1 of http api to v2 for a more comprehensive example.

graph LR
    subgraph Web UI 1
    A[Web UI 1]
    end

    subgraph Web UI 2
    B[Web UI 2]
    end

    subgraph API Gateway
    AG[API Gateway]
    end

    subgraph gRPC Applications
    GRPC1[gRPC App V1]
    GRPC2[gRPC App V2]
    end

    subgraph HTTP Applications
    HTTP1[HTTP App V2]
    HTTP2[HTTP App V3]
    end

    A -->|communicates with| AG
    B -->|communicates with| AG
    AG -->|to| GRPC1
    AG -->|to| HTTP1
    AG -->|to| GRPC2
    AG -->|to| HTTP2


josephaw1022 avatar Jan 16 '24 19:01 josephaw1022