Read OSS

Kong/kong

7 articles

Prerequisites

01

Kong Gateway Architecture: How an API Gateway Lives Inside Nginx

A comprehensive introduction to Kong's architecture, explaining how it embeds itself into Nginx via OpenResty's lua-nginx-module and the phase-driven lifecycle model.

02

From `kong start` to Serving Traffic: The Boot Sequence

Traces Kong's complete initialization pipeline from CLI dispatch through configuration loading, Nginx spawn, and the init/init_worker phases.

03

Anatomy of a Request: Kong's Runloop from Rewrite to Log

A detailed walkthrough of a single HTTP request's journey through every Nginx phase inside Kong, covering the runloop handler's before/after pattern and the request context lifecycle.

04

The Plugin System: Resolution, Execution, and the Art of the Iterator

Explores Kong's plugin architecture from discovery through execution, covering the plugins iterator's collecting/collected pattern and 8-level configuration resolution.

05

Schema-Driven Design: Kong's Database Layer from Validation to Query

Examines the schema system that drives Kong's entire data layer — from the metaschema through entity definitions to auto-generated DAOs and Admin API endpoints.

06

Hybrid Mode: Control Planes, Data Planes, and Configuration Sync

Explores Kong's distributed deployment architecture where Control Planes push configuration to Data Planes via WebSocket connections.

07

Kong as an AI Gateway: The LLM Driver Architecture

Examines Kong's AI/LLM gateway subsystem with its driver-based provider abstraction, streaming support, and the ai-proxy plugin family.