API Gateway Solution (BEAST)
One line — A single API Gateway that unifies many different provider APIs (Netflix, Disney, Kakao …) under one authentication / routing layer. Now the core engine of KT API-Link, reliably handling 50M+ requests/day.
What it does
The solution consists of an API Gateway Core System and a back-office portal for monitoring and managing APIs. It unifies different API interfaces and centralizes authentication / authorization, collapsing a complex integration structure into a single gateway.
Impact
- Unified different API interfaces (e.g., Netflix, Disney) and centralized authentication / authorization, simplifying a complex integration structure into a single gateway.
- Integrated into KT API-Link, where it now operates as the core engine of the API integration platform, reliably handling over 50 million requests per day.
Live service: KT API-Link.
Tech stack
Key roles & achievements
The project was carried out in three phases over two years.
⊙ Phase 1 — Back-Office Portal
- Dashboard: real-time monitoring of API status and performance.
- API Management: registration, modification, deletion and lifecycle management.
- Data Collection & Aggregation: scheduled periodic log aggregation.
- Community Support: announcements and user-community features.
⊙ Phase 2 — System Integration (KT API-Link)
- Integrated the gateway into KT API-Link and improved system performance.
- Query Performance Optimization: composite indexes and optimized data structures.
- Handler Management: customizable deployment and configuration.
- Security: adjustments for infrastructure such as firewall environments (added bypass functions).
⊙ Phase 3 — Core Enhancement & WebFlux Migration
- Migrated to a Reactive REST API with WebFlux for high-performance processing.
- Non-blocking ORM: applied R2DBC and Reactive MongoDB.
- Thread Pool Optimization: resolved blocking I/O by leveraging Netty’s event-loop and offloading async tasks to separate thread pools (TaskScheduler).
- Performance Testing: TPS / response-time analysis with Apache Bench, then optimization.
Troubleshooting — Thread-pool exhaustion bottleneck
Issue: After certain APIs were registered, request processing slowed dramatically — some requests were delayed for tens of seconds or never responded. The cause and the responsible API were initially unclear, causing continuous response delays across the whole system.
Root cause: The gateway lets you insert custom handlers at intermediate stages (JSON↔XML conversion, format transformation, external API calls). Many handlers made blocking calls to external providers. When an external response was slow, the blocking code held Netty Worker Threads for a long time → EventLoop exhaustion → throughput collapse. JPA-based DB access added further small blocking.
Resolution:
- Separated blocking operations into dedicated thread pools (e.g., TaskScheduler), letting the main EventLoop do pure I/O only.
- Converted blocking calls to multi-threaded asynchronous execution, so one slow handler no longer affects the whole system.
- Migrated DB operations (e.g., log insertion) to Reactive MongoDB and R2DBC, minimizing blocking.
- After restructuring, the gateway reliably handled high traffic without degradation, preventing recurrence of operational incidents.
한 줄 요약 — 서로 다른 공급사 API(Netflix, Disney, Kakao …)를 하나의 인증·라우팅 계층으로 통합한 단일 API Gateway. 현재 KT API-Link 의 핵심 엔진으로 하루 5,000만 건 이상 의 요청을 안정적으로 처리한다.
무엇을 하는가
이 솔루션은 API Gateway Core System 과 API 모니터링·관리를 위한 백오피스 포털 로 구성된다. 서로 다른 API 인터페이스를 통합하고 인증·인가를 중앙화하여, 복잡한 연동 구조를 하나의 게이트웨이로 단순화한다.
성과
- 서로 다른 API 인터페이스(예: Netflix, Disney)를 통합하고 인증·인가를 중앙화하여, 복잡한 연동 구조를 하나의 게이트웨이로 단순화했다.
- KT API-Link 에 통합되어 API 통합 플랫폼의 핵심 엔진으로 동작하며, 하루 5,000만 건 이상 의 요청을 안정적으로 처리한다.
실서비스: KT API-Link.
기술 스택
핵심 역할 & 성과
프로젝트는 2년에 걸쳐 3단계 로 진행되었다.
⊙ 1단계 — 백오피스 포털 개발
- 대시보드: API 상태·성능 실시간 모니터링.
- API 관리: 등록·수정·삭제 및 생명주기(lifecycle) 관리.
- 데이터 수집·집계: 주기적 로그 집계 스케줄링.
- 커뮤니티 지원: 공지·사용자 커뮤니티 기능.
⊙ 2단계 — 시스템 통합 (KT API-Link)
- 게이트웨이 솔루션을 KT API-Link 에 통합하고 시스템 성능을 개선.
- 쿼리 성능 최적화: 복합 인덱스 적용 및 데이터 구조 최적화.
- 핸들러 관리: 커스터마이즈 가능한 배포·설정 기능 구현.
- 보안 대응: 방화벽 환경 등 인프라 특성에 맞춘 기능 조정(우회 기능 추가).
⊙ 3단계 — 코어 고도화 & WebFlux 전환
- 고성능 처리를 위해 WebFlux 기반 Reactive REST API 로 전환.
- 논블로킹 ORM: R2DBC, Reactive MongoDB 적용.
- 스레드 풀 최적화: Netty 이벤트 루프 구조를 활용하고 비동기 작업을 별도 스레드 풀(TaskScheduler)로 재구성하여 blocking I/O 해소.
- 성능 테스트: Apache Bench 로 TPS·응답시간 분석 후 최적화.
트러블슈팅 — 스레드 풀 고갈 병목
문제: 특정 API 들이 등록된 이후 클라이언트 요청 처리가 크게 느려졌고, 일부 요청은 수십 초간 지연되거나 아예 응답하지 못했다. 처음에는 원인과 어떤 API 가 문제인지 불분명해 시스템 전반의 응답 지연이 계속되었다.
원인 분석: API Gateway 구조는 중간 처리 단계에 커스텀 핸들러 를 삽입해 JSON↔XML 변환, 요청 포맷 변환, 외부 API 호출 등을 처리한다. 그런데 많은 핸들러가 외부 공급사 API 호출 시 blocking 방식 으로 동작했다. 외부 응답이 지연되면 blocking 코드가 Netty Worker Thread 를 오래 점유하여 EventLoop 스레드 고갈 이 발생, 전체 처리량이 급감했다. 또한 코어가 JPA 기반 ORM 으로 DB 에 접근하면서 소규모 blocking 이 추가로 더해졌다.
해결 및 핵심 조치:
- blocking 작업을 전용 스레드 풀(예: TaskScheduler)로 분리하여, 메인 EventLoop 은 순수 I/O 처리만 담당하도록 함.
- blocking 호출을 멀티스레드 비동기 실행 으로 전환하여, 한 핸들러의 지연이 전체 시스템에 영향을 주지 않도록 함.
- 로그 적재 등 DB 작업을 Reactive MongoDB·R2DBC 로 이전하여 시스템 전반의 blocking 최소화.
- 재구성 이후 게이트웨이는 성능 저하 없이 고트래픽을 안정적으로 처리하여 운영 장애 재발을 방지.