Skip to content

Tags

#go

Go services, concurrency, tooling and the standard library, with real-world patterns.

13 posts

Posts tagged #go

  1. Question

    Go + Postgres: ¿pgx directo o database/sql? (y cómo manejan el pool)

    Parce, sigo aprendiendo Go con tincho (gracias maestro) y ya estoy pasando un servicio pequeño de Node a Go. Tengo dudas con Postgres: ¿Usan pgx directo ( pgxpool ) o database/sql con el driver pgx/v5/stdlib ? Leí que pgx directo es más rápido pero no sé si vale la pena. ¿Cuántas conexiones ponen en el pool? En Node tenía max: 10 en pg y no sé si en Go es igual. ¿sqlc o escribir las queries a mano? El servicio es…

    Camilo Restrepo5likes6comments

  2. Experience

    Our reconciliation job was wrong every day for a week because London changed its clocks

    Story from March that I promised a few people. Clocks go back again on the 25th, so this is the right week. I work from Enugu for a London fintech. Nigeria is UTC+1 all year, no daylight saving. London is UTC+0 in winter and UTC+1 in summer. Our partner bank sends a settlement file per "London business day", midnight to midnight London time. Our reconciliation job builds the same window on our side and matches…

    Emeka Nwosu21likes8comments

  3. Article

    Your Go service has 600 Postgres connections and uses 6 of them

    Last month a routine scale-up took down our orders database. Not CPU, not disk. Connections. Postgres said FATAL: sorry, too many clients already and every service that touched it fell over together. How we got there 40 pods of one Go service, each with a pgx pool. Nobody had set MaxConns , so pgxpool used its default: the larger of 4 and runtime.NumCPU() . Our nodes have 16 cores. 40 times 16 is 640 possible…

    Danny Cho22likes8comments

  4. Article

    context.Context en Go, explicado como se lo explicaría a un amigo en un asado

    Che, Camilo me preguntó el otro día "¿para qué sirve el ctx que todo el mundo pasa como primer parámetro?" y le contesté con un audio de 7 minutos. Lo paso a texto para que le sirva a alguien más. Qué es, en una frase context.Context es un valor que viaja con tu request y lleva tres cosas: un deadline (hasta cuándo tenés tiempo), una señal de cancelación (che, pará, ya no hace falta) y algunos valores del request…

    Martín Ferraro8likes7comments

  5. Article

    Idempotency keys in Go: the version that survives a double tap and a dead inverter

    Customer taps Pay. The request goes out on a 3G connection in Onitsha, reaches our API, the charge succeeds, and the response dies somewhere on the way back. The app sees a timeout and retries. Without protection, that is two charges and one very angry customer calling the merchant, who calls us. Same thing happens when NEPA takes light in the middle of a request and the client's inverter takes three seconds to kick…

    Emeka Nwosu26likes9comments

  6. Article

    Idempotent payment endpoints in Go and Postgres: the pattern that stopped our double charges

    For six months we refunded somebody almost every Monday. Same story every time: customer on a bad connection taps Pay, the request reaches us, the PSP charges them, our response never reaches the phone, the app retries, we charge again. This is the pattern we use now. Zero double charges since February. The rules Every POST that moves money requires an Idempotency-Key header. No key, 400. The client generates it…

    Emeka Nwosu22likes14comments

  7. Article

    The goroutine leak that took three weeks to find (the fix was four lines)

    One of our Go services gained about 40 MB of memory a day. Nobody noticed, because we deploy every day and a deploy restarts every pod. Then came a holiday change freeze. Twelve days without a deploy. On day nine the pods started getting OOMKilled, one by one, during the busiest week of the year. Finding it The service already imported net/http/pprof on an internal port, which is the single best decision anyone made…

    Danny Cho35likes11comments

  8. Article

    Developer survival guide from Tehran: npm, Docker, Go, GitHub and the 403 lifestyle

    سلام. I write backend for a ride hailing and delivery app in Tehran, Go and Python, team of 14. Many people outside do not know what sanctions mean for a normal developer, and many developers in other sanctioned countries ask me the same questions. So this is the long version. Everything here is about using public open source and running things ourselves. Nothing exotic. The real problem is over-compliance US…

    Arash Karimi48likes14comments

  9. Experience

    One year after the twelve days: what I changed in how I work

    Last June, for twelve days, there was a war over my head. I do not want to explain Iran in one post, I cannot, and people who ask me to do it in one comment are usually not asking a real question. I only want to write what happened to my work, because many developers in many countries may need this one day, and I hope they never do. The first nights we heard explosions in Tehran. My parents went to my aunt in the…

    Arash Karimi12likes11comments

  10. Article

    Two winters on solar and a battery in Joburg: the real numbers, and what I'd do differently

    Howzit. A few people asked after my comment in the homelab thread, so here's the long version. Ja, it's long. Make tea. Context for the non-South Africans: for a few years "load shedding" was just life here. Scheduled power cuts, two to four hours at a time, sometimes three times a day, announced by stage (stage 2, stage 4, stage 6 when things were really bad). You planned your cooking, your gym, your deploys and…

    Lindiwe Mokoena16likes12comments

  11. Article

    A normal workday in Kyiv during blackouts, hour by hour (with my power setup)

    Few people asked after my air raid deploy post how a normal day looks. So here is one. Not the worst day, not the best. Tuesday. I work remote for a Danish company, Go and Postgres, team of 6. Kyiv is one hour ahead of Copenhagen, which is the only easy part. 06:40 Wake up, before coffee I check the outage schedule in the energy company app and in our district Telegram channel. Kyiv is split in groups, my building…

    Oleksii Bondarenko88likes36comments

Get the best of Dynamo Geeks weekly

One email each Monday with the most useful posts. No spam; unsubscribe in one click.