Category: Programming

Always Sort by ID — An Interesting Gotcha

If you’re writing a database query for your web service and there’s pagination, you should always sort by a unique field like ID. This should also be done on top of any other sorting. Otherwise you can get double entries or lose results across pages.

Rgeo — 5 Years On

5 years ago I wrote Rgeo, a small Go package for reverse geocoding (you input some coordinates, it gives you information about the location). Today I am putting the projected on an indefinite hiatus.

Applying Hexagonal Architecture to a Mid-Size Go Backend

I’ve been working on web backends in Go for the past 5 years, and on various projects of covering a range of ages from brand new greenfield projects to one built on top of a core that predates the Go language. The needs of these backends tend not to be overly complex, handling user management, payments, and a relativly simple product. They’re maintained by teams of 2-20 backend engineers and work with a SPA web frontend communicating with JSON over HTTP.

With my most recent work being mostly greenfield, I’ve been thinking more about how I can apply what I’ve learned from my colleagues working on older projects, and avoid decisions made in the name of moving fast which cause a lot of pain further down the line.