about upstream?

110 views
Skip to first unread message

xie cui

unread,
Nov 2, 2022, 5:15:51 AM11/2/22
to golang-nuts
there are two micro service writen in go, let's call them A and B. A will call B. In this scene we will call B is the upstream of A. or A is the upstream of B? which one is correct way?

Konstantin Khomoutov

unread,
Nov 3, 2022, 5:06:50 AM11/3/22
to xie cui, golang-nuts
I'm not a native speaker but I would say that using the term "upstream" is not
really fit for this particular case unless A really _streams_ data from B -
that is, opens a long-lived connection with the amount of data to be
transferred not known before making a request, and with the request usually
lasting until B goes offline or A loses interest in receiving the data.
A very good example of streaming is transferring some sort of "events" (for
instance, "realtime" data from a stock exchange, messages in a chat system
etc).

Otherwise, if A makes short-lived requests to B, I would just call B
"a server" and A - "a client". The both parties may be programmed in a way
that B also requests some data from A, and in this case they switch roles;
this is fine.

TheDiveO

unread,
Nov 3, 2022, 5:18:33 PM11/3/22
to golang-nuts
I've seen both usages depending on the writers' perspectives. For that reason I avoid the terms upstream and downstream in this context (services) like the plague and always ask people for clarification without using these two words. It's always fun to see this then sparking totally surprised reaction in others taking part in those conversations.

The OP is perfectly right to ask this usinthe term "up/downstream" in the context of services, as I've seen and heard this often times for REST-based APIs, both from native as well as non-native speakers.

Chris Burkert

unread,
Nov 4, 2022, 8:27:56 AM11/4/22
to TheDiveO, golang-nuts
I am also not a native speaker, but having a stream/river in mind, then upstream seems to be where the water comes from and downstream where the water is going to.
However, the OP mentioned that one micro service called the other which tells me something about how the connection is established, but that does not tell me how data is actually "flowing". Maybe in both directions :-)

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/80af4dc5-3c18-4f2a-a52b-026a93d0dac8n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages