rinha2-back-end-go

Documentation

Operator notes for the Go 1.25.0 Rinha de Backend 2024/Q1 implementation. These pages are source-backed against the current repository: the Go API lives in src/WebApi/main.go, compose topology in docker-compose.yml and prod/docker-compose.yml, database functions in docker-entrypoint-initdb.d/rinha.dump.sql, and the docs routes in docs/src/lib/sidebar.config.ts.

RuntimeGo 1.25.0
Resource cap1.5 CPU
Memory cap550MB
Implemented endpoints3 routes

Start here

01 · challenge Read the contest contract

Required banking endpoints, client model, validation rules, and resource limits.

02 · architecture Inspect the runtime topology

NGINX least-connection balancing, two Go API containers, PostgreSQL stored procedures, and dev-only observability services.

03 · getting started Run the local stack

Clone, compose, health-check, smoke-test transactions, and query statements through port 9999.

04 · performance Review benchmark evidence

Resource envelope, report archive, and the limits of historical benchmark claims.

05 · source audit Check implementation/documentation edges

Over-limit debit behavior, statement fields, compose differences, and path-filter boundaries.

Implementation snapshot

Signal Value Source
Language Go 1.25.0 src/WebApi/go.mod
Router chi/v5.2.5 go.mod, main.go
Database client pgx/v5.9.2 with pgxpool go.mod, main.go
Database strategy PostgreSQL stored procedures over UNLOGGED tables docker-entrypoint-initdb.d/rinha.dump.sql
Load balancer NGINX least_conn on port 9999 nginx.conf
API endpoints /healthz, /clientes/{id}/transacoes, /clientes/{id}/extrato src/WebApi/main.go
Reports 34 committed k6 HTML reports docs/public/reports/

Fast path

git clone https://github.com/jonathanperis/rinha2-back-end-go.git
cd rinha2-back-end-go
docker compose up nginx -d --build
curl http://localhost:9999/healthz
curl http://localhost:9999/clientes/1/extrato