Wrangling slow reports, large file exports, and long-running tasks in Rails with ActiveJob

Sometimes we need to generate really large file exports or run reports that are just slow. It’s not enough to optimize a few queries, we need to move the work to a background job and notify the user when it’s all. In every non-trivial application you’ll have to do something that is just slow. You need to export a large data set to a CSV file. An analyst needs a complicated Excel report. Or maybe you have to connect to an external API and process a whole bunch of data.So how do you know when it’s time to use background jobs?If you try building these kinds of reports in a normal Rails controller action, you will see these symptoms:.
Wrangling slow reports, large file exports, and long-running tasks in Rails with ActiveJob #ruby #rubydeveloper #rubyonrails #activejob https://rubyonrails.ba/single/wrangling-slow-reports-large-file-exports-and-long-running-tasks-in-rails-with-activejob

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles