CLI tool
gofiber/fiber avatar
gofiber/fiber

Fiber v3: Express-style routing on Fasthttp, with a zero-allocation catch

Project brief: Express inspired web framework written in Go. Fiber is an Express inspired web framework built on top of Fasthttp , the fastest HTTP engine for Go .

40,157 stars2,031 forksGoMIT

At a glance

What is it?
Fiber brings Express-style handlers to Go, built on Fasthttp for speed. The v3 line raises the Go requirement and makes context reuse a hard rule, which is the real trade-off to weigh.
Who is it for?
Adopt Fiber if you want an Express-like API in Go with Fasthttp's performance profile and you can live with the zero-allocation rule: never keep references to context values beyond a handler. Do not adopt it if you need a stable API across Go versions below 1.25, if you require the full net/http middleware ecosystem, or if you cannot train your team to avoid storing c.Values.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly Go, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What Fiber actually is and who it serves

Fiber is a web framework for Go that borrows its handler signature and routing style from Express.js. The README states that it is built on Fasthttp, the HTTP engine from valyala, and that it aims for zero memory allocation and high performance. The target user is explicit: new gophers coming from Node.js who want a familiar API while moving to Go. If you have written Express routes, Fiber's app.Get with a handler taking a context and returning an error will feel close to home. This is not a general-purpose Go framework like net/http with extra helpers; it is a deliberate re-implementation of Express semantics on a different HTTP stack. That matters because the underlying engine changes what you can assume about request handling.

How it works: Fasthttp underneath, Express on top

The core mechanism is that Fiber does not use Go's standard net/http package. It uses Fasthttp, which reuses objects across requests to reduce allocations. The README is blunt about the consequence: values returned from fiber.Ctx are not immutable by default and will be reused across requests. Inside a handler you can read params, query strings, and body data, but you must not keep a reference to any of that data after the handler returns. The routing model mirrors Express: you define methods like Get and Post on the app, pass a path and a handler, and the handler returns an error. Middleware support is present via the Next function, and the feature list includes static file serving, WebSocket support through a contrib package, server-sent events, and a rate limiter. The data flow is straightforward: a request comes into Fasthttp, Fiber maps it to a route, the handler runs, and the response is written. The zero-allocation claim is not a marketing line; it is a contract you must honor in your own code.

Getting it running: commands and the Go 1.25 gate

Installation follows the standard Go module path. The README instructs you to initialize a module with go mod init github.com/your/repo, then run go get -u github.com/gofiber/fiber/v3. The quickstart example is a complete server: fiber.New() creates the app, app.Get("/", handler) registers a route, and app.Listen(":3000") starts it. The one hard requirement is Go version 1.25 or higher. That is a recent release, and it will exclude teams on older toolchains. The example uses the v3 import path, which is the current major version. If you are on v2, the import path differs, and the README does not document the migration steps. The setup cost is low if you already have Go 1.25; the framework handles the HTTP server lifecycle, so you do not need to wire up a separate server object.

The zero-allocation rule: a real footgun, not a feature

The README states that context values are reused across requests and that you must only use them within the handler. That is a sharp constraint. In a typical Go web app, you often want to extract a user ID from a path parameter, store it in a struct, and use it later in a goroutine or a background job. Fiber forbids that pattern by default. If you keep a reference to c.Params("id") or c.Body() and use it after the handler returns, you will read data from a later request. The documentation page linked in the README covers this, but the README itself is clear enough. This is not a bug; it is the price of zero-allocation performance. For teams that are new to Go, this rule is easy to violate. The framework does not stop you at compile time; it produces subtle race-like bugs at runtime. If your application needs to pass request data to asynchronous tasks, you must copy the values explicitly before the handler returns. That is extra code and a discipline requirement that Express developers will not have.

Performance claims: what the README does and does not prove

The README links to TechEmpower benchmarks and to the project's own benchmark page. It says Fiber is built on Fasthttp, which it calls the fastest HTTP engine for Go, and that Fiber is optimized for high performance and low memory. The README does not publish specific numbers in the snippet provided, so I cannot confirm any particular requests-per-second figure. The TechEmpower link is to a specific round, but the results are not reproduced here. What is clear is that the design choices, like zero allocation and object reuse, are consistent with a performance-oriented framework. You should treat the performance claim as plausible but unverified from this material. If you are choosing a framework purely on benchmark numbers, you will need to run your own tests against your workload. The zero-allocation rule is the strongest evidence that the project takes performance seriously, because it sacrifices ergonomics for speed.

Where Fiber is the wrong tool

Fiber is not a drop-in replacement for net/http. Because it sits on Fasthttp, any middleware or library that expects http.Request or http.ResponseWriter will not work directly. The README lists WebSocket and Socket.io support through contrib packages, but it does not claim compatibility with the broader Go ecosystem. If your project depends on a net/http middleware like a specific auth library or a metrics exporter, you will need to adapt it or find a Fiber-specific version. The Go 1.25 requirement is another boundary: if your production environment is pinned to an older Go version, you cannot use v3. Also, the Express-inspired API is a double-edged sword. It lowers the barrier for Node.js developers, but it may hide Go idioms. For example, the error handling pattern, returning an error from a handler, is familiar to Express users but differs from how net/http handlers work. Teams that already know Go well might prefer a framework that follows net/http conventions more closely.

Alternatives: net/http and Gin take different paths

The most direct alternative is Go's standard net/http package. It does not use Fasthttp, so it has a different performance profile, but it gives you compatibility with the entire Go ecosystem. With net/http, you write your own routing or use a third-party router, and you do not get the Express-like handler signature. Another common alternative is Gin, which is a popular Go web framework. Gin uses net/http underneath, so it works with standard middleware and libraries. Gin's API is also handler-based, but it does not impose the same zero-allocation reuse rule; context values in Gin are generally safe to keep after the handler returns, though you should still copy them for goroutines. The key difference is the underlying engine: Fiber commits to Fasthttp for speed, while Gin stays on net/http for compatibility. If you value ecosystem compatibility over raw speed, Gin or plain net/http is the safer choice. If you want the Fasthttp performance and you can live with the constraints, Fiber is the only one of these that gives you that stack directly.

Maintenance and upgrade cost

The repository shows active maintenance: the last push is from August 2026, and there are recent releases for both v3.5.0 and v2.52.15. That dual-track release pattern means the project supports two major versions at once. The README does not explain the differences between v2 and v3, nor does it provide a migration guide in the snippet. That is a gap. If you adopt v3 today, you should expect breaking changes when v4 arrives, and you will need to track the release notes on your own. The license is MIT, which is permissive and does not impose restrictions on commercial use, but this is not legal advice. The maintenance cost is moderate: the framework is actively updated, which means you should budget time for dependency upgrades. The zero-allocation rule also adds a long-term maintenance burden because every handler you write must be reviewed for context reference leaks. That is a code review cost that does not exist with net/http-based frameworks.

Editorial conclusion

Adopt Fiber if you want an Express-like API in Go with Fasthttp's performance profile and you can live with the zero-allocation rule: never keep references to context values beyond a handler. Do not adopt it if you need a stable API across Go versions below 1.25, if you require the full net/http middleware ecosystem, or if you cannot train your team to avoid storing c.Values. Before committing, verify that your existing Go middleware and libraries work with Fasthttp's request and response types, and test the v3 API against your routes, since v3 is a major version with breaking changes from v2.

Official sources

  1. Official documentation
  2. Official README
  3. Project repository
  4. Release notes
Community notes

Community notes