Introduction

If you are familiar with Express, you may recognize that Fiber is inspired by the awesome Node.js framework — except it is written in Go. Why?

Well, because Go is very fast, low on memory footprint, and highly performant for building scalable web servers and applications.

Fiber leverages these performance benefits and features. Firstly, it is based on the fasthttp package, which is the fastest HTTP client library in the Go ecosystem. From benchmark results, fasthttp is 10 times as fast as the net/http native Go client package.

In this post, we are going to explore Fiber by looking at its features and components, such as routing, middleware support, and context. At the end of the day, we should then be able to apply these features and build a demo application that interacts with a database of our choice.

Prerequisites

To easily follow along with this tutorial, we should have at least a basic knowledge of the Go programming language. It might also be beneficial to know a little bit of Express, as this could help in quickly understanding Fiber from an architecture point of view.

Also, make sure you have the Postgres.app for your OS of choice — you can download it here. Also, you can install any GUI client for Postgres. In this article, we will be using Postico, which you can download here.

Finally, make sure you have the latest version of Go installed on your machine. Instructions to do so can be found in the documentation.

In the coming section, we will talk briefly about the motivation behind Fiber. Let’s go.

#go #fiber #express #api #developer

Building an Express-style API in Go with Fiber
2.60 GEEK