go-pg VS httprouter

Compare go-pg vs httprouter and see what are their differences.

go-pg

Golang ORM with focus on PostgreSQL features and performance (by go-pg)

httprouter

A high performance HTTP request router that scales well (by julienschmidt)
Our great sponsors
  • Scout APM - A developer's best friend. Try free for 14-days
  • Nanos - Run Linux Software Faster and Safer than Linux with Unikernels
  • SaaSHub - Software Alternatives and Reviews
go-pg httprouter
4 11
4,883 13,415
1.0% -
7.2 0.0
8 days ago 19 days ago
Go Go
BSD 2-clause "Simplified" License BSD 3-clause "New" or "Revised" License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

go-pg

Posts with mentions or reviews of go-pg. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-09-06.

httprouter

Posts with mentions or reviews of httprouter. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-10-07.
  • Swagger-UI gives a 404 not found error when using Julien Schmidt's HTTP router
    1 project | reddit.com/r/golang | 27 Oct 2021
    I'm trying to set up the swagger using julien schmidt's HTTP router, but the setup returns a 404 Error Not Found every time. Anything that I'm missing out on here. Link to the router: https://github.com/julienschmidt/httprouter
  • HttpRouter
    1 project | reddit.com/r/devopskhan | 27 Oct 2021
  • BunRouter: Zero allocations HTTP router for Go
    2 projects | reddit.com/r/golang | 7 Oct 2021
    As for the first question, see https://github.com/julienschmidt/httprouter/issues/73 and the lack of middlewares.
  • Go for Backend development
    4 projects | reddit.com/r/golang | 6 Sep 2021
    Pass on the frameworks at first. just use the std library's net/http package and maybe a really basic router like julien schmidt's httprouter(https://github.com/julienschmidt/httprouter) to do your requests and use pgx(https://github.com/jackc/pgx) for postrgres.
  • What are your favorite packages to use?
    55 projects | reddit.com/r/golang | 15 Aug 2021
    httprouter for routing. Several years ago (5 years ago maybe) when I started using Go, I always tried to use the best and fastest packages and this package boasts itself as the fastest router for Go. Fast forward to today, I'm not sure if it still the fastest around, but it's stable and I've never had issues with it, so I keep using it.
  • Noob here. Need recommendation for best REST API framework.
    12 projects | reddit.com/r/golang | 19 Jul 2021
    I use (and love) gorilla/mux as well as julienschmidt/httprouter. They are both on the "lightweight" end of the spectrum. Nothing (to my knowledge) beats the performance of julienschmidt/httprouter, but routing isn't going to be your main bottleneck anyway, so I don't think it matters too much. If you wanted to get started with gorilla, gowebexamples.com is a nice starting point.
  • What's your favourite (go) web framework?
    5 projects | reddit.com/r/golang | 13 Jun 2021
    For me, the middle ground is best, chi, gin, httprouter are the sweetspot. But that's based on skills, style, and requirements (and experience - I've used all the ones I have mentioned in anger)
  • Networking with go
    2 projects | reddit.com/r/golang | 3 Apr 2021
  • What should i pay attention to when building web server that should hold long connections
    2 projects | reddit.com/r/golang | 24 Mar 2021
    therefore, use the gorilla mux router but don't use gorilla sessions, just build your server as being a request based api. If you want to build a chat application or a video streaming platform, then just build your own concept of a session (gorilla is great don't get me wrong, but it's a dependency). I agree with not using gorilla session as it's unnecessarily heavy and it sounds like OP could get away with returning a token to the clients which they'll set as a http header on every request, if sessions are even needed. That being said gorilla mux is also a dependency and pretty much the worst performing router out there. Use the stdlib mux or if you need something more sofisticated I'd recommend httprouter or chi but chi had a semver issue recently and the community was pretty pissed about it so maybe not chi. Using the gorilla mux is also a dependency.
  • Choosing building blocks to move faster
    4 projects | dev.to | 1 Feb 2021
    Another common reason to decide against using an existing component is when it doesn't satisfy your requirements. For this project, I needed to prioritize the performance of the web server, and so I knew I needed an HTTP framework that performed well across a number of benchmarks, but I also needed some unusual capabilities such as being able to swap out the router in real-time. In the end, I decided on a hybrid approach for the web server, choosing to build a custom framework around the well-loved httprouter, which granted the majority of what I needed, and had some extremely well thought-out integration points that made it easy for me to build on top of it. In the case of the message bus, I also had a requirement of decentralization, which the majority of available projects are not.

What are some alternatives?

When comparing go-pg and httprouter you can also consider the following projects:

GORM - The fantastic ORM library for Golang, aims to be developer friendly

chi - lightweight, idiomatic and composable router for building Go HTTP services

Gin - Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.

Echo - High performance, minimalist Go web framework

SQLBoiler - Generate a Go ORM tailored to your database schema.

ent - An entity framework for Go

fasthttp - Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http

mux - A powerful HTTP router and URL matcher for building Go web servers with 🦍

Xorm

beego orm

Iris - The fastest HTTP/2 Go Web Framework. AWS Lambda, gRPC, MVC, Unique Router, Websockets, Sessions, Test suite, Dependency Injection and more. A true successor of expressjs and laravel | 谢谢 https://github.com/kataras/iris/issues/1329 |

Goji - Goji is a minimalistic and flexible HTTP request multiplexer for Go (golang)