API routing patterns
In agile development environments, autonomous teams (for example squads and tribes) own one or more services that include many microservices. The teams expose these services as APIs to allow their consumers to interact with their group of services and actions.
There are three major methods for exposing HTTP APIs to upstream consumers by using hostnames and paths:
Method |
Description |
Example |
---|---|---|
Expose each service as a hostname. |
|
|
Expose each service as a path. |
|
|
Expose each service as an HTTP header. |
|
This section outlines typical use cases for these three routing methods and their trade-offs to help you decide which method best fits your requirements and organizational structure.