Before using an API gateway, clients must call each service separately, increasing complexity. After applying the API gateway pattern, clients call a single endpoint, and the gateway handles routing and aggregation, simplifying client code.
### Before: Clients call services directly
import requests
user_response = requests.get('http://user-service/api/users/123')
order_response = requests.get('http://order-service/api/orders?user=123')
### After: Clients call API Gateway
import requests
gateway_response = requests.get('http://api-gateway/api/user-orders/123')
# API Gateway routes internally to user and order services and aggregates response