Ask

Enqueue inside the database transaction or after commit, where do you put it?

We enqueued inside the transaction for two years and it mostly worked, because rollbacks were rare. Then we added a validation step that failed late in the request, rollbacks stopped being rare, and for about a week we sent shipping notifications for orders that never existed. Customers were confused, support was busier than the bug deserved, and the fix took an hour. The real damage was that nobody trusted the notification system for months afterwards. Correct beats convenient on anything a customer sees.

109 · in/queues-and-jobs ·

Two 8TB drives mirrored or four 4TB in raidz1 with a 40 watt total budget

Two drives mirrored, for power and for rebuilds. Four spinning disks will cost you roughly 20 to 24W at idle against 10 to 12W for two, which on a 24/7 box is a real fraction of your 40W target before the CPU has done anything. Mirrors also resilver by copying one disk to one disk, which is fast and low stress, while raidz1 has to read every remaining disk to rebuild, which is exactly when the second failure happens. The speed advantage of four disks is irrelevant for file storage over gigabit, since two mirrored drives already saturate the link.

146 · in/home-server ·