Subscribe
Tag

Architecture

12 posts

Crafting API routes: best practices for clean design

Naming API routes after resources, nesting, versioning, the right HTTP methods and status codes, RFC 9457 error bodies and when a 4xx or 5xx is safe to retry, with a small Go 1.22+ ServeMux API and real curl output for each rule.

5 min read

Building maintainable golang code with SOLID principles

The five SOLID principles in Go with programs that actually compile and run on Go 1.27: one job per type, rules you add without editing old code, an io.Writer that breaks its contract, small interfaces at the consumer, and a payment fake in go test.

6 min read

Monolith first: a pragmatic approach to microservices architecture

Why I start new products as a modular monolith, and how to build one in Go: modules with internal packages the compiler protects, small consumer interfaces between modules, one schema per module, and the signals that say a module is ready to become its own service.

5 min read

Feature documentation for web services

What a feature doc for a web service should hold, a short template, OpenAPI as the contract, and a small Go test that fails the build when a route is missing from the spec or an example in the docs stops matching the real response.

5 min read

ORM vs query builder: a comparison and use case analysis

GORM and squirrel run the same Postgres 18 query side by side: what SQL each one really sends, the zero value trap in GORM Updates, dynamic filters with a query builder, and when I would pick each one (plus where sqlc fits).

6 min read

Implementing a multiple schema multi-tenant system in golang

A schema per tenant HTTP API in Go 1.27 with pgx: tenant from the subdomain, SET LOCAL search_path inside a transaction, and a real demo of how a plain SET leaks one tenant's schema to the next request through the connection pool. Part 4 of the multi-tenant series.

6 min read
ID

Multi-tenant systems: choosing an identity management tool

What to check in an identity provider for a multi-tenant app, the main options in late 2026 (Keycloak, Auth0, Zitadel, FusionAuth, Ory, Gluu), and a working Keycloak 26 Organizations setup with a Go API that takes the tenant from a verified token. Part 2 of the series.

6 min read