Bifrost

A low latency and high throughput API Gateway library written in Go.
Reasons to use Bifrost
- Low latency and high throughput.
- Allows writing middlewares in native
Go
.
- Easy to integrate with existing Go services.
- Easy migration from Nginx. Leverage your Nginx experience.
- Built as an SDK/library instead of an artifact.
Feature highlights
- Support for writing middleware in
Go
.
- Low latency and high throughput (powered by the Hertz framework).
- Millisecond-level graceful reload for route updates without interrupting requests.
- Get gateway configurations from local files or configuration centers.
- Built-in Prometheus monitoring.
- Built-in OpenTelemetry tracing.
- Supports
HTTP1.1
/HTTP2
/H2C
/Webosocket
/GRPC
protocols.
- Multiple strategies for load balancing (
round_robin
, random
, weighted
, hashing
)
Comparative Analysis
|
Bifrost |
Nginx |
SDK for building your own gateway |
✅ |
❌ |
Write your middlewares in native Go (not TinyGo ) |
✅ |
❌ |
Rich built-in middlewares |
✅ |
❌ |
Millisecond-level graceful reloads for dynamic configuration updates |
✅ |
❌ |
Blue-green deployment for services |
✅ |
❌ |
High connection pool reuse rate |
✅ |
❌ |
Easy integration with existing Go programs |
✅ |
❌ |
Built-in Prometheus monitoring |
✅ |
❌ |
Built-in OpenTelemetry tracing |
✅ |
❌ |
Native k8s service discovery |
✅ |
❌ |
Built-in web application firewall and support OWASP Core Rule Set |
✅ |
❌ |
HTTP2 upstream support |
✅ |
❌ |
Multiple configuration providers |
✅ |
❌ |
Standardized and User-Friendly Configuration |
✅ |
❌ |
High concurrency and low latency |
✅ |
✅ |
GRPC Load Balancer |
✅ |
✅ |
Multiple strategies for load balancing (round_robin , random , weighted , hashing ) |
✅ |
✅ |
Background task support |
✅ |
✅ |
Overview

servers
: Server configuration, supports middlewares, controlling which port to expose
routes
: Route configuration, controls request path forwarding rules to specific services
services
: Service configuration, controls service details such as protocol information
upstreams
: Upstream configuration, manages load balancing rules for backend hosts
Get Started
Set up a high-performance API gateway in 5 minutes
Documents
- Configuration
- Providers
- Routes
- Middlewares
- Directive
Credit
- CloudWeGo