DEV Community

Discussion on: Export Records to CSV Files with Rails

Collapse
 
von_christian profile image
Von Christian

How to run it in background job(Sidekiq) ?

Collapse
 
victorhazbun profile image
Victor Hazbun

It depends, are you going to send an email on a background job? or are you going to upload the file on S3? please give some context.

Collapse
 
von_christian profile image
Von Christian

from my experience, when large amounts of data is involved, the server times out. Im thinking if it is possible to move the CSV export and show a download link to the user?

Thread Thread
 
victorhazbun profile image
Victor Hazbun

Ok, then you will need to do the following:

  1. On a BG job generate the CSV file
  2. Upload the file to AWS S3
  3. Save the URL in the DB
  4. Expose the URL in the front-end