home

upstream/downstream service classification

2024-10-02

Within a single request served by the “ingress”, i.e., whatever the DNS points to1, it may internally talk to a plethora of other dependent services internally, before the responses are “aggregated” back to the “user”. For all the chatter that happens in the course of this, there are “upstream” and “downstream” services, but which is which?

A couple of definitions from RFC 9110, HTTP Semantics to aid our definitions, supported by these Stack Overflow answers 1 2.

RFC 9110, section 3.7. Intermediaries

The terms “upstream” and “downstream” are used to describe directional requirements in relation to the message flow: all messages flow from upstream to downstream. The terms “inbound” and “outbound” are used to describe directional requirements in relation to the request route: “inbound” means toward the origin server and “outbound” means toward the user agent.

RFC 9110, section 15.6.5. 504 Gateway Timeout

The 504 (Gateway Timeout) status code indicates that the server, while acting as a gateway or proxy, did not receive a timely response from an upstream server it needed to access in order to complete the request.


  1. this is the simplest definition↩︎


home