Transactions are only necessary when the change is tightly coupled.
---
In this case, it's okay for individual records to fail. They can either be manually processed, re-run, or root caused for failure and handled individually.
---
In this case, it's okay for individual records to fail. They can either be manually processed, re-run, or root caused for failure and handled individually.
Typically, these get run during off-peak hours. This running in 30 minutes vs 12 hours simply isn't important.
A lot of the work I do involves analyzing and improving Ruby applications' performance. Often, simply wrapping transactions around the database operations will help - without making other (often much needed) structural changes.