explaingit

cloudwego/hertz

7,215GoAudience · developerComplexity · 3/5Setup · moderate

TLDR

Hertz is a fast, extensible Go web framework built and battle-tested inside ByteDance that handles high volumes of HTTP traffic with low latency for backend microservices.

Mindmap

mindmap
  root((hertz))
    What it does
      HTTP web framework
      High performance
      Microservices
    Tech stack
      Go
      Netpoll
    Extensions
      WebSockets
      HTTP2 support
      Rate limiting
      Prometheus
    Audience
      Go developers
      Backend teams
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build high-performance HTTP microservices in Go that handle thousands of requests per second with low response times.

USE CASE 2

Replace a slower Go web framework with Hertz in a production backend to improve throughput without rewriting your logic.

USE CASE 3

Add WebSockets, HTTP/2, rate limiting, or Prometheus monitoring to a Go server using ready-made Hertz-contrib extensions.

Tech stack

GoNetpoll

Getting it running

Difficulty · moderate Time to first run · 30min

Requires Go installed. Companion extension packages live in the separate hertz-contrib GitHub org.

License not stated in the explanation.

In plain English

Hertz is a framework for building web server software written in the Go programming language. A framework is a set of pre-built tools and conventions that helps developers avoid starting from scratch every time they need to handle web traffic. Hertz was originally created inside ByteDance (the company behind TikTok) for internal use and is now open-sourced and available to the public. The main focus of Hertz is speed and flexibility. It uses a custom-built network library called Netpoll, which the same team developed, and this combination allows Hertz to handle large numbers of incoming requests quickly and with low delays. The README includes benchmark charts comparing it against three or four other popular Go frameworks, showing where it stands in terms of request throughput and response time. Hertz is built in layers, meaning different internal parts can be swapped or extended independently. Developers can switch between different underlying network libraries depending on the situation, add custom protocol handling, or plug in monitoring and logging tools without rewriting large portions of their application. A companion GitHub organization called Hertz-contrib maintains a collection of ready-made extensions for common needs, including WebSockets, HTTP/2 support, automatic HTTPS certificates, rate limiting, and Prometheus-based performance monitoring. The project targets teams building microservices, which are small, focused backend services that communicate with each other to form larger systems. It is not a visual product or an end-user application. If you write backend services in Go and want a framework that was stress-tested at ByteDance scale, Hertz is what this project offers. The documentation site (cloudwego.io) covers getting started guides, examples, feature explanations, and a FAQ.

Copy-paste prompts

Prompt 1
Using Hertz, create a Go REST API with routes for GET /users and POST /users that returns JSON responses and logs each request.
Prompt 2
How do I add rate limiting and Prometheus metrics monitoring to my Hertz-based Go service using hertz-contrib?
Prompt 3
Show me how to set up WebSocket support in a Hertz Go web server using the hertz-contrib websocket extension.
Prompt 4
Create a Go microservice with Hertz that authenticates requests via middleware and proxies allowed traffic to a downstream service.
Prompt 5
How do I swap the default Netpoll network library in Hertz for the standard net library and when would I want to do that?
Open on GitHub → Explain another repo

← cloudwego on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.