Arjun Mehta
Backend engineer at a lending startup in Bengaluru. Payments, ledgers, reconciliation, and the occasional 3am settlement file that does not add up. Postgres fan. Will talk about idempotency keys until you leave.
- Bengaluru, India
- English · Hindi · Kannada
- Joined Jul 2026
- Last posted Oct 18, 2026
Known for
- Posts
- 12
- Followers
- 15
- Following
- 26
- Reputation
- 308
Posts
Everything this author has published.
Going from CRUD backend to payments: things I wish someone told me
4 years back I was writing CRUD APIs for a food delivery startup. Then I joined a lending company, and in the first month I broke a reconciliation job, learned what a UTR is, and realised I did not know what a debit was. Writing this for anyone thinking about moving into fintech backend. Learn basic accounting before anything else. Not the full course. Just double entry, what assets and liabilities are, and why a…
I took our UPI collect flow down for 14 minutes on a Friday evening
Every Friday deploy story starts with "it was just a config change". So here is mine. Our partner bank rotates the public key they use to sign payment callbacks once a year. They emailed us the new key, I updated the config and deployed at 6pm on Friday because the old key was expiring on Saturday. Felt responsible. Was not. We run the callback service on 2 pods. The config came from a mounted secret, one pod picked…
Payment webhooks arrive twice, out of order, and sometimes never. Design for all three
Every payment gateway webhook doc says some version of "we may send the same event more than once". What they say less loudly: events can arrive out of order, and sometimes they dont arrive at all. Our first webhook handler assumed none of this. Here is the version that survived. 1. Twice: store the event id Every event has an id. Insert it into a processed_events table with a unique constraint before doing anything…
- point 2 is my black friday story. handler did everything inline, timed out, stripe retried, one dog groomer got 3 receipts and asked if she was being charged 3 times. she was not. she was however very confused
Payout worker queue in Postgres: SKIP LOCKED is holding transactions open for 30s, better way?
We have a payouts table and 4 worker processes that pick pending payouts and call the bank API. Right now each worker does this: begin; select * from payouts where status = 'pending' order by created_at limit 10 for update skip locked; -- call bank API for each row (can take up to 30s) update payouts set status = 'sent' where id = ...; commit; It works, no double picks. But the transaction stays open during the HTTP…
Reconciliation without losing your mind: matching ledger, gateway and bank
If you move money, at some point finance will ask "does our ledger match the bank". The honest answer at most startups is "mostly". This post is how we went from "mostly" to a daily report that finance actually trusts. It took us around 4 months, so dont feel bad if yours is still a spreadsheet. Three sources, not two For card and UPI payments you have three views of the same money: Your ledger: what you think…
Our settlement was off by ₹410 and it took three days to find why
Partner bank sends us a settlement file every morning. We compare it with our ledger and the totals should match to the paisa. One Monday it was off by ₹410.37. Not a lot of money. But a mismatch is a mismatch and finance will not close the day with it. First day we checked the obvious things. Missing transactions, duplicates, refunds settled on a different day. Everything matched row by row on the transaction…
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…
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…
- found this while prepping for a system design interview and "kill the process between the steps" is lowkey the best advice in here. saved
Best answers
Accepted answer
rust: cannot borrow `*self` as mutable because it is also borrowed as immutable
Classic one. The loop holds a borrow of self.items, and update wants all of self mutably, which includes items. A few normal fixes: 1. Make update not take…
Accepted answer
UK SaaS selling to EU customers: do i need to register for VAT there from the first sale?
Not tax advice, but this is the part people mix up. The €10,000 threshold is only for businesses established inside the EU. As a UK seller after Brexit you are…
Accepted answer
Django REST Framework: still N+1 queries after select_related, what am I missing?
select_related only follows ForeignKey and OneToOne, with a JOIN. Your 2 extra queries per row are the tags (ManyToMany) and the count. Do this: queryset =…
Accepted answer
Postgres count(distinct) on 80M rows very slow, any trick?
count(distinct) in Postgres sorts the input for each group, it cannot use a hash aggregate. Rewrite so the distinct happens in a subquery, then the planner can…
Answer people found useful
Daily sales report across timezones: which day does an order at 11:30pm Bangkok belong to?
We do both, explicitly. Store the market timezone on the order (or on a markets table) and compute business_date = (created_at at time zone market_tz)::date.…
Answer people found useful
Contract testing across 12 services: is Pact worth it or overkill?
We did Pact for payment flows between 5 services. It worked because we started with only the 2 integrations that broke most often, not everything at once. Few…
Answer people found useful
Engineers who have worked on UPI: why do failed transactions take days to reverse when the rule says T+1?
Adding to Vivek from the bank side. For deemed approved transactions the beneficiary bank has to file either a credit confirmation or a return in NPCI's…
Badges earned
Strongest tier first, then the most recently earned.
Century
SilverReached 100 reputation points.
Earned Oct 14, 2026
Well Received
SilverYour posts have collected fifty likes between them.
Earned Sep 26, 2026
Generalist
SilverPublished in three different topics.
Earned Sep 8, 2026
Problem Solver
SilverAn answer you wrote was accepted by the person who asked.
Earned Aug 24, 2026
Regular
SilverPublished ten posts. Showing up is most of it.
Earned Aug 10, 2026
Settling In
BronzeA month since you joined.
Earned Oct 18, 2026
Getting Started
BronzeReached 25 reputation points.
Earned Oct 10, 2026
First Readers
BronzeYour posts have been read a hundred times.
Earned Oct 6, 2026
Worth Keeping
BronzeSomebody saved one of your posts to read again.
Earned Oct 3, 2026
Quotable
BronzeYour comments have earned ten likes.
Earned Oct 1, 2026
First Applause
BronzeSomebody liked something you wrote.
Earned Sep 24, 2026
Someone’s Listening
BronzeSomeone followed you for the first time.
Earned Sep 18, 2026
Finding People
BronzeFollowing five people. Enough for a feed with something in it.
Earned Sep 13, 2026
Explorer
BronzeJoined five topics and settled into the community.
Earned Sep 1, 2026
Straw Poll
BronzeCreated your first poll and asked the community to decide.
Earned Aug 28, 2026
Curious
BronzeAsked your first question. Nobody starts out knowing.
Earned Aug 22, 2026
Said Hello
BronzeLeft your first comment on somebody else’s post.
Earned Aug 12, 2026
First Post
BronzePublished your first post on Dynamo Geeks.
Earned Jul 30, 2026