Distributed Systems Middleware:
Kong API Gateway
Course: BIT3
Module: Distributed Systems
Instructor: Dr. O. Casimir
Group Members
1. FIDERIS HAROLD BALALA - 03.9455.01.01.2022
2. COSTA VICTON SANGA - 03.8501.01.01.2022
3. ALLY ABDALLAH SAFFAR - 03.9457.01.01.2022
4. HUSSEIN R NGAPAWA - 03.1019.01.01.2022
• Kong API Gateway :
Kong API Gateway is an open-
source, flexible, and high-
performance API Gateway and
What is microservices management layer.
Kong API
Gateway? • Role as Middleware:
- Acts as an intermediary layer
between clients and microservices.
- Manages routing, security,
monitoring, and analytics.
• API Request Routing
Key
Routes client requests to appropriate microservices.
• Authentication and Authorization
Features OAuth 2.0, JWT Token Validation, API Key authentication.
• Rate Limiting
of Kong Limits the number of requests to prevent abuse.
API
• Load Balancing
Ensures fair distribution of requests across services.
Gateway • Monitoring and Analytics
Integration with Prometheus, Datadog, and ELK Stack.
• Caching
Reduces latency by storing frequently requested data.
• Middleware Role:
Kong acts as an intermediary between clients and
microservices by:
- Intercepting Client Requests
Kong is the first point of contact for all client requests.
How Kong - Evaluating Requests & Routing Them Appropriately
Functions as Routes are dynamically defined to ensure correct traffic
delivery
Middleware - Applying Cross-Cutting Concerns
Examples: Authentication, logging, rate limiting,
monitoring.
- Transforming Responses
Manipulates responses from microservices before sending
them back to clients
• Scenario: E-commerce application with multiple
microservices (User Management, Product
Catalog, Order Processing).
• Flow of Events:
Example
- Client sends a request to fetch user details: GET
Scenario /users/:id. - Kong intercepts the request.
- Kong performs Authentication and ensures the
with Kong's token is valid.
Middleware - Kong enforces Rate Limiting (e.g., 100 requests per
minute per client).
Role - Kong routes the request to the correct
microservice endpoint.
- Response from the User Service is sent back to
Kong
- Kong sends the transformed response back to the
client.
• Kong can be deployed in multiple ways
- Kong Gateway (Open Source)
Self-managed deployment on your own
Deployment servers.
Models of - Kong Cloud
Managed version hosted by Kong itself.
Kong
- Kubernetes-Based Kong Gateway
Integrated with Kubernetes for
containerized deployments
• Open-Source & Customizable
Extensive plugin support and flexibility.
• Scalability
Handles high traffic loads with reliability.
Advantages • Centralized Security
Single entry point for enforcing security mechanisms.
of Using
Kong API • Simplified Service Orchestration
Manages communication between microservices.
Gateway • Developer-Friendly
Intuitive configurations and powerful plugins.
• Observability & Monitoring
Integration with monitoring tools like Prometheus,
Datadog
• Operational Overhead
Managing Kong instances and
updates can become resource-
intensive.
Challenges • Plugin Configuration Complexity:
with Kong Misconfiguration can lead to
service interruptions.
• Learning Curve:
A range of features to master for
new users.
Conclusion
Kong API Gateway's Role as Middleware:
- Manages routing, authentication, monitoring, and load balancing.
- Simplifies communication across microservices and client applications.
- Reduces latency, improves system security, and provides analytics.
-Kong is a powerful solution for modern distributed systems, leveraging advanced
capabilities for scalable, secure, and efficient microservices management.
https://docs.konghq.com/gat
References & eway/latest/
Acknowledgment
https://www.geeksforgeeks.o
rg/what-is-api-gateway-syste
m-design/
https://medium.com/swlh/ko
ng-api-gateway-zero-to-produ
ction-5b8431495ee