What is Upstream and Downstream services in a Micro-service based architecture?
Solution 1
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.
Solution 2
The downstream services are the ones that consume the upstream service. In particular, they depend on the upstream service. More generally, upstream services don't need to know or care about the existence of downstream services. Downstream services care about the existence of upstream services, even if they only optionally consume them.
http://reflectoring.io/upstream-downstream
Solution 3
I see it is a metaphor of water flow: the origin of a river is upstream, the outlet is downstream.
But in practice it is gibberish. Nowadays services exchange data through different means. A service can call another service to fetch data, it can also call the other service to push data. A service can receive data from another service by calls out first or it can receive data passively, like receiving push notification.
At work, you can use it judiciously: if someone who's more senior than your calls a service upstream service, go with it; if you are the most senior one on the team, name whatever you like.
Solution 4
Upstream and Downstream in a Production Process
Upstream and Downstream Software Dependencies
A picture is worth a thousand words !!
Solution 5
It's the stream of service, so the provider is upstream and the consumer is downstream.
Related videos on Youtube
Shubham Tiwari
I love to Code and what keeps me going is the challenges that i face during developing something. Code Blooded
Updated on July 09, 2022Comments
-
Shubham Tiwari almost 2 years
I have heard of the terms "Upstream Services" and "Downstream Services" in general terms but i came across some articles on micro-service architecture where they have used these terms , however i wasn't able to get what an upstream and downstream service in a micro-service based architecture would be ? does someone has a brief explanation ?
I already know that Upstream services are those that do not depend on any other services and downstream services depending on the upstream services for example the front end would be a downstream service to the back end as it depends on it.
I am developing the micro-services in .Net Core.
-
Atanu Roy over 4 yearsThere are tons of resources in the internet explaining this topic in detail. This could be good start point - softwareengineering.stackexchange.com/questions/312401/…
-
Shubham Tiwari over 4 yearsI have already seen this source but this is mainly in general terms not specific to micro-services , can you provide me a link for micro-services ? i have tried searching on the net but i haven't found one !
-
Atanu Roy over 4 yearsIf you are building an API Gateway for micro-services, maybe looking at the documentation of Ocelot will give you some idea about how they define downstream and upstream - ocelot.readthedocs.io/en/latest/features/routing.html
-
Lee Grissom over 2 yearsAdd this question to the list of unsolved problems in computer science. :)
-
-
Michal Trojanowski about 4 yearsHere's a nice article which supports what you say: reflectoring.io/upstream-downstream
-
Bernd almost 4 yearsI had the same understanding. Until today when I learned it's the other way around. With good arguments. See softwareengineering.stackexchange.com/questions/312401/…, and in reflectoring.io/upstream-downstream as pointed out below by Michael in the comment.
-
tom redfern almost 4 yearsHi @Bernd very interesting discussion. Maybe we should have a vote and settle it once and for all!
-
Gaurav about 3 yearsthat's an awesome analogy!