Search code examples
microservicesapi-gateway

What is Upstream and Downstream services in a microservices based architecture?


I have heard of the terms "Upstream Services" and "Downstream Services" in general terms but I came across some articles on microservices architecture where they have used these terms. I wasn't able to understand what an upstream and downstream service in a microservices based architecture would be? Can somebody give me a brief explanation?

I already know that upstream services are those that do not depend on any other services and downstream services depend on the upstream services. For example, the front-end would be a downstream service to the backend as it depends on it.

I am developing the microservices in .Net Core.


Solution

  • Definition 1: The direction of action

    Upstream: receiving requests from / sending responses to

    • A service upstream is calling me.

    Downstream: making requests to / receiving responses from

    • I am calling a service downstream.

    Definition 2: The direction of dependency

    Upstream: making requests to / receiving responses from

    • I am calling a service upstream.

    Downstream: receiving requests from / sending responses to

    • A service downstream is calling me.

    So,

    There are resources on the internet which support both of these definitions. Maybe we will resolve this question one day, but for now the answer is: it's either.