April 1, 2021
Here is the link.
Forces
- Mismatch between the fine-grained microservices and needs of the clients
- Different clients need different data
- LAN vs. WAN vs. Mobile network performance
- The number of service instances and their locations (host + port) changes dynamically
- Partitioning into services can change over time and should be hidden from clients
Directly connecting the front-end to the backend
API gateway pattern vs directly talk to Microservice
Pattern: API gateway
Single entry point - API Gateway
Client specific APIs
REST catalog service
REST Recommendation service
Thrift Review service
Protocol translation
Example: Netflix API
thousand streaming clients - Device specific end points
Benefits of the API gateway
- Insulates the clients from the partitioning
- Insulates the clients from the problem of discovery
- Provides the optimal API for each client
- Reduces the number of requests/ roundtrips
- Simplifies the client by moving logic for calling multiple services from the client to API gateway
- Gateway translates between web-unfriendly protocols and HTTP/WebSockets
No comments:
Post a Comment