Load Balancing
- Improving Performance: By distributing requests across multiple service instances, API gateways improve the system’s overall performance and ensure that no single instance is overwhelmed.
- Scalability: Load balancing allows the system to scale horizontally by adding more instances to handle increasing loads.
Why do we need API gateway?
An API gateway is a server that acts as an intermediary between clients (such as mobile apps or websites) and backend services (such as databases or other services). It is a key component in microservices architecture, providing a single point of entry for clients to access multiple services.
The API gateway handles all the tasks related to accepting and processing incoming requests, such as routing requests to the appropriate service, performing authentication and authorization, enforcing rate limits, and aggregating responses from multiple services.
Let’s understand why we need an API gateway: