

Bernard Sarfo Twumasi
7.9K posts

@devsarfo
Senior Fullstack Developer at Admincontrol AS









The thing happening in La Liga right now, Sevilla are 4 points away from playing UCL and 4 points away from relegation If this happened in the prem you’ll be hearing how competitive it is



Your registration endpoint shouldn’t leave orphaned users in the database when the welcome email fails to send. The problem: user creation lives in PostgreSQL. Email sending lives in an external service. You can’t wrap both in a single database transaction. The fix: if the email fails, delete the user and their invitation. This is the SAGA pattern. When a multi-system operation fails partway through, you compensate by undoing the completed steps. Built this today in Go with Resend for email delivery and PostgreSQL transactions for the rollback.





"The fix: if the email fails, delete the user and their invitation" That’s not a fix, that’s punishing the user for your infrastructure failing. No production system should delete an account just because a welcome email couldn’t be sent. Retry the email. Queue it. Notify the user. But forcing them to re-register because your mail server hiccupped is terrible UX.