Upstreams
In this document, you will learn the basic concept of an upstream object in API7 Enterprise Edition and why you would want to use it. You will be introduced to a few relevant features, including service discovery, upstream health checking.
Overview
An upstream object in API7 Enterprise Edition is a logical abstraction of a set containing one or more upstream addresses. It is required in services to specify where requests flow to and how they are distributed.
Here is an example of such a configuration in service routes, where the same upstream address is repeated across three different service routes:
As you can probably see, large-scale systems with many services would benefit significantly from configuring identical groups of upstream addresses in upstream objects, reducing redundant information and operational costs.
Service Discovery
While it is straightforward to figure upstream addresses statically, in microservice-based architectures, upstream addresses are often dynamically assigned and therefore, changed, during autoscaling, failures, and updates. Static configurations are less than ideal in this case.
Service discovery comes to rescue. It describes the process of automatically detecting the available upstream services, keeping their addresses in a database (called a service registry) for others to reference. That way, an API gateway can always fetch the latest list of upstream addresses through the registry, ensuring all requests are forwarded to healthy upstream nodes.
API7 Enterprise Edition supports integrations with many service registries, such as Consul, Eureka, Nacos, Kubernetes service discovery, and more.
For more details about how to integrate with third-party service registries, please see Service Discovery (coming soon).
Upstream Health Checking
API7 Enterprise Edition provides active and passive health checking options to probe if upstream nodes are online (a.k.a. healthy). Unhealthy upstream nodes will be ignored until they recover and are deemed healthy again.
More details about how to configure upstream health checking will be provided in Active and Passive Health Checking (coming soon).