API GATEWAY
David
- AWS Managed Service
- In Front of Your Applications
- Serverless
- Resource / Method Level Control
- HTTP / RESTful / WebSocket API
- Authorize
- Rate Limit / Throttle
IMAGE: https://dashbird.io/knowledge-base/api-gateway/what-is-an-api-gateway/
WHY
•Legacy API
- Complicated Authorization Mechanism
- Resource / Method Legacy Design
- Complicated Payload
- Performance
- From JSON Input Transform To XML
•Microservice
- Don’t wanna publish all API
- Monitoring
- Easy To Collect API Logs
•Serverless
- This Is A Serverless Architecture,
Which Means Scalability And Reliability Could be AWS’s Responsibility
- Integrate With Lambda or Fargate
Solution
- DDOS Defense ( By Rate-Limit )
- Throttle API Requests (429 Too Many Requests)
- Authorization Management
- IAM Permission
- Lambda
- Cognito
- Some APIs Shouldn’t Public
- Handle CORS
- Handle API Key
Security & Authorization
Solution
- Standardization API URI
- xxxxx.com/v1.0/ec2
- xxxxx.com/v1.1/vpc
- Dashboard to Monitor API Usage
- Do Not Modify/Refactor Backend Codebase As Possible As We Can
- New/Old Version Could be Online In Parallel
- Could be Combined With Developer Portal
- One APIGW, Multiple-Backends but also Single Entrance
Microservice
BUT
- Who Should Manage The APIGW?
- Normally Developer Should Responsible For Their Own API
- When You’re Modifying The API, You’ll Have To Do Twice
- IaC Integration & IaC CI/CD & CodeReview
- Flexible & Easy-Using IaC Modules
- Learning Curve
- Single Point of Failure
- Debugging Could be Harder
- CI/CD and Deployment Challenges
IMAGE: https://divante.com/blog/10-companies-that-implemented-the-microservice-architecture-and-paved-the-way-for-others/
What Do We Want
•Key Requirements
- Single Entry Point
- Auth
- URL Route Standardization
- Traffic Control & Rate Limit
- Formatting Transformation
•Security & Networking
- ACL / SSL / WAF / Token Management
- HA / LoadBalancing
- Scalability
- CDN
•Development
- Developer Portal & Swagger
•Operation
- Canary / A-B / Blue-Green Deployment
- API Key Management
- Logging / Monitoring / Alert

API Gateway within Microservice

  • 1.
  • 2.
    - AWS ManagedService - In Front of Your Applications - Serverless - Resource / Method Level Control - HTTP / RESTful / WebSocket API - Authorize - Rate Limit / Throttle
  • 5.
  • 8.
    WHY •Legacy API - ComplicatedAuthorization Mechanism - Resource / Method Legacy Design - Complicated Payload - Performance - From JSON Input Transform To XML •Microservice - Don’t wanna publish all API - Monitoring - Easy To Collect API Logs •Serverless - This Is A Serverless Architecture, Which Means Scalability And Reliability Could be AWS’s Responsibility - Integrate With Lambda or Fargate
  • 9.
    Solution - DDOS Defense( By Rate-Limit ) - Throttle API Requests (429 Too Many Requests) - Authorization Management - IAM Permission - Lambda - Cognito - Some APIs Shouldn’t Public - Handle CORS - Handle API Key Security & Authorization
  • 10.
    Solution - Standardization APIURI - xxxxx.com/v1.0/ec2 - xxxxx.com/v1.1/vpc - Dashboard to Monitor API Usage - Do Not Modify/Refactor Backend Codebase As Possible As We Can - New/Old Version Could be Online In Parallel - Could be Combined With Developer Portal - One APIGW, Multiple-Backends but also Single Entrance Microservice
  • 11.
    BUT - Who ShouldManage The APIGW? - Normally Developer Should Responsible For Their Own API - When You’re Modifying The API, You’ll Have To Do Twice - IaC Integration & IaC CI/CD & CodeReview - Flexible & Easy-Using IaC Modules - Learning Curve - Single Point of Failure - Debugging Could be Harder - CI/CD and Deployment Challenges
  • 12.
  • 13.
    What Do WeWant •Key Requirements - Single Entry Point - Auth - URL Route Standardization - Traffic Control & Rate Limit - Formatting Transformation •Security & Networking - ACL / SSL / WAF / Token Management - HA / LoadBalancing - Scalability - CDN •Development - Developer Portal & Swagger •Operation - Canary / A-B / Blue-Green Deployment - API Key Management - Logging / Monitoring / Alert