Great framing. "what correct means" is exactly the hard part. The mechanisms I'd want to see named. Idempotency keys on every transfer, so retries never double-move money. An immutable double-entry ledger: never update balances in place, balances are a derived projection over the entry log. Debit/credit pairs inside a single DB transaction with proper isolation. And settlement retries keyed off the transfer record's state machine, not blind re-submission. Get those right and most "ghost money" bugs disappear.
Parsa Aftabi
Backend & Full-Stack Engineer — building high-performance systems and clean APIs. Go · TypeScript · React · PostgreSQL · Redis · Docker
Great framing. "what correct means" is exactly the hard part. The mechanisms I'd want to see named. Idempotency keys on every transfer, so retries never double-move money. An immutable double-entry ledger: never update balances in place, balances are a derived projection over the entry log. Debit/credit pairs inside a single DB transaction with proper isolation. And settlement retries keyed off the transfer record's state machine, not blind re-submission. Get those right and most "ghost money" bugs disappear.