OSS API Gateways typically come bundled with built-in load-balancing capabilities. We see this with Netflix Zuul and Kong.
In a service-oriented architecture, where many microservices are talking to many others, is the idea that each service has its own API Gateway, with its own load balancer that can serve traffic to all the nodes of that service? Or is it typical to have a single Gateway routing traffic to load-balancers for each service behind it? And if the latter, then why do OSS gateways typically feature load-balancing as first-class citizens?
For instance, pretend a backend consists of 3 web services: Orders, Payments & Shipping:
- Orders keeps track of catalog (orderable) items and receives orders from client apps
- When Orders WS receives an order request, it contacts Payments WS to handle the payment
- Then after Payments returns a successful response (payment was successful), Orders WS reaches out to Shipping WS to handle warehouse/packaging/shipping logistics
Is there typically:
- A single API Gateway for the client app to call into, which then routes the order request to Order WS's load balancer (say, at
https://orders.example.com
) which in turns serves traffic to one of the Order WS instances (kicking off the order processing flow); or... - One API Gateway for each service? And the client app calls Order WS's Gateway/Balancer, which then forward traffic to an Order WS instance, which then calls Payment WS's Gateway/Balancer, which then forwards traffic to a Payment WS instance, etc.?
I was under the impression it was the former case, but Zuul and Kong both advertising load-balancing as a major feature is throwing me off. Any ideas?