Writing
Blog
Engineering notes, architecture decisions, and the occasional post-mortem.
Prisma Decimal is not a number: the NaN bug that reached production
backendJanuary 20, 2026
Prisma Decimal is not a number: the NaN bug that reached production
A settlement job started writing amount: NaN in production. The cause wasn't the maths — it was assuming Prisma hands back plain JS numbers. Here's the trap and the fix.
What a real-time betting backend actually needs
architectureDecember 8, 2025
What a real-time betting backend actually needs
Sockets are the easy part. The hard part is settlement that stays correct, queues that don't double-pay, and a matching engine that agrees with itself under load.