Skip to content

Tags · page 2

#backend

Posts tagged #backend on Dynamo Geeks: 38 posts from the community, most useful first.

38 posts · back to page 1

Posts tagged #backend

  1. Article

    Enums, readonly and match: the PHP 8 features that made my juniors' code reviewable

    Code review in my agency used to be 40% "what values can this string have?" and "who changed this amount after the controller?". PHP 8 killed most of those comments. Here are the features that did it, with the code we actually write now. 1. Backed enums (8.1) enum OrderStatus: string { case Pending = 'pending'; case Paid = 'paid'; case Shipped = 'shipped'; case Cancelled = 'cancelled'; public function label():…

    Ayesha Siddiqui23likes14comments

  2. Article

    A double-entry ledger in Postgres, the boring way that works

    Every fintech I have worked at started with a balance column on the users table. And every one of them later spent months moving away from it. If you are building anything where money moves between parties, wallets, marketplaces, lending, start with a ledger. It is less work than it sounds and Postgres gives you almost everything you need. This is the design we run in production now. Nothing fancy. Boring is the…

    Arjun Mehta4likes4comments

  3. 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

  4. Article

    FHIR for backend developers who were just told "we need FHIR"

    Since three years I spend most of my working time between hospital systems, and the most common message I get from other developers is some version of: "the customer says we need FHIR, what is it and how bad is it?" So here is the introduction I wish someone had given me. It is not complete. It is the part you need in the first two weeks. What FHIR actually is FHIR (Fast Healthcare Interoperability Resources,…

    Hannah Weiss8likes6comments

  5. 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

  6. 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

  7. Article

    Idempotency keys for payment APIs: what we got wrong the first time

    Last year we had a customer charged twice for the same EMI. Not a big amount, but the customer was right to be angry and our support team spent one full day itself on it. The root cause was not the bank, not the gateway. It was us, and the way we did idempotency keys. Sharing what we got wrong, because since then I have seen the same mistakes in two other codebases. What an idempotency key is supposed to do The…

    Arjun Mehta10likes9comments

  8. Article

    The index that made our query slower, and other things EXPLAIN ANALYZE told me

    Short version: someone added an index "because we order by that column", and the dispatcher dashboard went from 40 ms to 9 seconds for our smallest depots. The someone was me. I found out on the bike home, which is 14 km, which is enough time to stop being angry at yourself. The query SELECT id, reference, created_at FROM shipments WHERE depot_id = 42 AND status = 'pending' ORDER BY created_at DESC LIMIT 50;…

    Bram Verhoeven41likes13comments

  9. Article

    Stripe webhooks in Laravel: verify, queue, return 200, and stop double-fulfilling orders

    Kids are asleep, so here's the webhook setup we've been running on an ecommerce client for two years. It came out of a Black Friday where we shipped some lucky customers two of everything. Not Cashier, plain stripe-php, because the client has a custom checkout. Why webhooks go wrong Stripe retries a webhook if you don't answer with a 2xx quickly, and it keeps retrying for up to three days. If your handler does the…

    Imran Hussain16likes7comments

  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

    Laravel queues that don't fall over: Horizon + Supervisor on a cheap VPS

    Every few weeks a junior in my team (or a freelancer in my DMs) shows me a production server where the queue worker is running inside screen . It works until the server reboots, or the worker eats a bad job and dies at 3am, and then the client calls me asking why no invoices went out since Tuesday. Uff. So here is the setup we actually use. Nothing fancy. A 2 vCPU / 4 GB VPS for about 12 dollars a month runs Redis,…

    Ayesha Siddiqui44likes11comments

Get the best of Dynamo Geeks weekly

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