Back to Catalog
Cloud
aws
API Routing - Hostname
Route API requests based on the hostname in the request
Intent & Description
The Hostname Routing pattern routes API requests to different backend services based on the hostname in the request. This allows multiple services or versions of the same service to be exposed through different hostnames while using a single API gateway or load balancer. It is useful for multi-tenant applications, version routing, or separating environments.
Real-world Use Case
Use when you need to route requests to different services based on the hostname, such as multi-tenant architectures or version-specific routing.
Source
Advantages
- Simple and straightforward routing mechanism
- Enables multi-tenant architectures
- Supports version-based routing
- Easy to implement with DNS and load balancers
Disadvantages
- Limited to hostname-based routing
- Requires DNS configuration
- Can lead to hostname proliferation