- Updated service template structure in `ARCHITECTURE.md` and `README.md` for clarity and usability. - Enhanced bilingual documentation across skills, increasing the number of available skills from 15 to 25. - Added new sections on event-driven architecture, inter-service communication, and performance optimization. - Improved formatting and removed outdated references to streamline the documentation experience.
46 lines
2.0 KiB
Markdown
46 lines
2.0 KiB
Markdown
# API Gateway Nâng Cao (API Gateway Advanced)
|
|
|
|
Advanced API Gateway patterns for GoodGo microservices including API composition, request/response transformation, service mesh integration, advanced routing, and gateway-level resilience.
|
|
> Các patterns API Gateway nâng cao cho GoodGo microservices bao gồm API composition, request/response transformation, tích hợp service mesh, routing nâng cao, và resilience ở gateway level.
|
|
|
|
## Tổng Quan
|
|
|
|
Advanced API Gateway patterns extend basic gateway functionality with composition, transformation, service mesh integration, and gateway-level resilience patterns.
|
|
|
|
Các patterns API Gateway nâng cao mở rộng chức năng gateway cơ bản với composition, transformation, tích hợp service mesh, và các resilience patterns ở gateway level.
|
|
|
|
## Khi Nào Sử Dụng
|
|
|
|
Use this skill when implementing API composition, request/response transformation, or service mesh integration.
|
|
|
|
Sử dụng skill này khi implement API composition, request/response transformation, hoặc tích hợp service mesh.
|
|
|
|
## Các Patterns Chính
|
|
|
|
### API Composition / API Composition
|
|
|
|
```typescript
|
|
// EN: Aggregate multiple service responses
|
|
// VI: Tổng hợp responses từ nhiều services
|
|
const [user, orders, payments] = await Promise.all([
|
|
userClient.get(`/users/${userId}`),
|
|
orderClient.get(`/orders?userId=${userId}`),
|
|
paymentClient.get(`/payments?userId=${userId}`),
|
|
]);
|
|
```
|
|
|
|
## Best Practices / Thực Hành Tốt
|
|
|
|
1. Use API composition for aggregating related data / Sử dụng API composition để tổng hợp dữ liệu liên quan
|
|
2. Cache at gateway / Cache ở gateway
|
|
3. Implement circuit breaker at gateway / Implement circuit breaker ở gateway
|
|
|
|
## Skills Liên Quan
|
|
|
|
- [Middleware Patterns](./middleware-patterns.md) - Middleware patterns / Các patterns middleware
|
|
- [Resilience Patterns](./resilience-patterns.md) - Circuit breaker / Circuit breaker
|
|
|
|
## Tài Nguyên
|
|
|
|
- Skill Source: `.cursor/skills/api-gateway-advanced/SKILL.md`
|