Skip to content

Repository files navigation

Bifrost GoDoc Build GoReport Security Coverage Status CodeWiki

A low-latency and high-throughput API gateway library in Go

Reasons to use Bifrost

  1. Low latency and high throughput.
  2. Allows writing middlewares in native Go.
  3. Easy to integrate with existing Go services.
  4. Easy migration from Nginx. Leverage your Nginx experience.
  5. Built as an SDK/library instead of an artifact.

Feature highlights

  1. Support for writing middleware in Go.
  2. Low latency and high throughput (powered by the Hertz framework).
  3. Millisecond-level graceful reload for route updates without interrupting requests.
  4. Get gateway configurations from local files or configuration centers.
  5. Built-in Prometheus monitoring.
  6. Built-in OpenTelemetry tracing.
  7. Supports HTTP1.1/HTTP2/H2C/Webosocket/GRPC protocols.
  8. Multiple built-in balancer algorithm (round_robin, random, weighted, chash) and allow to build your own

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 ✅ ❌
Multiple built-in balancer algorithm and allow to build your own ✅ ❌
High concurrency and low latency ✅ ✅
GRPC Load Balancer ✅ ✅
Background task support ✅ ✅

Overview

flow

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

  1. Configuration
  2. Providers
  3. Routes
  4. Middlewares
  5. Directive

Credit

  1. CloudWeGo

About

A low-latency and high-throughput API gateway library in Go

Topics

Resources

Stars

10 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages