Maxim Mironjuk
-
May 15, 2025
A trigger that handles an extra check or logging step on every INSERT looks harmless and convenient at first glance. Only under load does it become clear that triggers run synchronously inside the same transaction context, extending lock times, raising deadlock risk, and producing errors that are hard to trace back. On frequently updated tables in a Magento shop, such as stock or orders, the choice between trigger, event scheduler, and application logic directly decides stability under load.