4 ms·
Perhaps because your example fails to describe what happens if there is a crash, after updating the database to say "email sent", but before the email has actua
by abraae 11y ago
Perhaps because your example fails to describe what happens if there is a crash, after updating the database to say "email sent", but before the email has actually been sent.
- amelius 11y agoWell, I didn't want to go into that much detail here, because that also presents a problem in the case of locks (if the locking process crashes, the lock is never released).
- bryanh 11y agoGood observation! The article also covers that exact scenario - plus a solution called fencing which a proper locking system can help facilitate.
- amelius 11y agoI like the fencing solution. Couldn't such a scheme be implemented over a database instead? Why I'm thinking more in terms of a database-oriented solution is because there is still the problem of crashing. What happens if the system crashes just before the email is sent? The system somehow needs to remember to restart that task (sending the email) when it comes back up. And this is probably best done through a database anyway.