How I Stopped Node.js from Freezing While Bulk-Processing 1,500+ Excel Rows

TL;DR AI
2 min readKey summary
A Node.js Excel bulk import was optimized after 1,500 student rows overwhelmed the app in a single sequential loop.
The original flow mixed bcrypt hashing, Postgres writes, and SMTP emails inline, causing timeouts and connection pressure.
The fix kept database writes inside one transaction with per-row SAVEPOINTs for partial rollback.
Email jobs were collected during import and sent only after the transaction finished, separating slow external work from DB transactions.
