How ByteDance’s Kitex Revolutionized Golang RPC for High‑Performance Microservices

This article chronicles ByteDance's transition from Python to Go, the shortcomings of the first‑generation Kite RPC framework, and the design, features, performance advantages, open‑source journey, and real‑world deployment lessons of the next‑generation Kitex framework for scalable microservices.

Volcano Engine Developer Services
Volcano Engine Developer Services
Volcano Engine Developer Services
How ByteDance’s Kitex Revolutionized Golang RPC for High‑Performance Microservices

Background and Evolution

Since 2014, ByteDance’s rapid business growth required high‑concurrency services, exposing performance and development‑efficiency limits of Python. The company adopted Go, launching the first‑generation Golang RPC framework Kite in 2016, which wrapped Apache Thrift and added internal governance features.

As business scaled, Kite accumulated technical debt—tight coupling with internal services, poor Go modules support, fragmented repositories, and limited protocol extensibility—prompting a redesign that resulted in Kitex.

Kitex Release and Adoption

Kitex v1.0 was released internally in 2020, quickly integrating with over 1,000 services. By mid‑2021, more than 20,000 services used Kitex, leading to its open‑source release.

Kitex Architecture

The framework consists of four components:

Kitex Core : the core RPC framework with built‑in microservice governance.

Kitex Byted : a collection of extensions that integrate ByteDance’s internal infrastructure.

Kitex Tool : a CLI that generates service scaffolding and code.

Second Party Packages : underlying network libraries such as netpoll and netpoll‑http2 , also open‑sourced under CloudWeGo.

Kitex architecture diagram
Kitex architecture diagram

Key Features

Open‑source friendly : Kitex Core avoids hard‑coded dependencies on internal infrastructure; extensions are injected via the Option pattern, enabling independent evolution.

Rich governance : built‑in timeout, circuit‑breaking, retries, load balancing, generic calls, and data passthrough, all customizable through middleware and resolvers.

Extensibility via Suite : developers can package custom functionality (e.g., custom service discovery, load balancing) into a single Suite, simplifying configuration.

Multi‑protocol support : supports Thrift, Protobuf, and custom protocols; the network layer leverages high‑performance netpoll with FastRead/FastWrite codecs.

Performance Benchmarks

Benchmarks in January 2022 show Kitex using Thrift outperforms official gRPC, achieving nearly double the throughput, and also surpasses gRPC when using a custom Protobuf protocol.

Kitex vs gRPC performance chart
Kitex vs gRPC performance chart

Demo Walkthrough

Developers define an IDL (e.g., Thrift), run the Kitex CLI to generate service code, implement handler logic, build with go mod tidy, and start the server (default port 8888). A client can then be written to import the generated code, create a client instance, and invoke RPC methods.

Integration with Internal Infrastructure

Kitex integrates logging, monitoring, tracing, service discovery, and service mesh via Options injected at startup. The Suite mechanism bundles these dependencies, allowing seamless adoption across services.

Case Study: Merged Deployment

To reduce network and serialization overhead, ByteDance introduced merged deployment, co‑locating strongly dependent services on the same machine and using a shared‑memory communication protocol. Kitex supports this via specialized service discovery and connection‑pool implementations, resulting in a 19% CPU reduction and 29% lower P99 latency for a major service.

Merged deployment performance impact
Merged deployment performance impact

Challenges and Mitigations

Slow upgrades : automatic version checks in the code‑generation tool and proactive announcements in user groups.

Slow recall : version distribution monitoring, deployment gate checks, and rapid banning of problematic versions.

Debugging difficulty : extensive Wiki documentation, debug ports enabled by default, and on‑site support from framework developers.

Open‑Source Practices

Efforts include code splitting and sanitization, comprehensive documentation, example repositories, website construction, community user groups, automated issue handling via Feishu bots, and contributor rewards. The CloudWeGo/Kitex repository has amassed over 4.1k stars.

Future Outlook

Upcoming work focuses on JIT‑based optimizations for Thrift, extending Protobuf performance gains, supporting xDS for cloud‑native integration, and enhancing compatibility with public‑cloud infrastructures.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

BackendMicroservicesGolangRPCOpenSourceKitex
Volcano Engine Developer Services
Written by

Volcano Engine Developer Services

The Volcano Engine Developer Community, Volcano Engine's TOD community, connects the platform with developers, offering cutting-edge tech content and diverse events, nurturing a vibrant developer culture, and co-building an open-source ecosystem.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.