RubyFlow The Ruby and Rails community linklog

How to import millions CSV rows via ActiveRecord in minutes (not hours)?

Rails is know to suffer GC performance issue in importing millions records via AR. Traditionally, people opt to use SQL INSERT(s) however this method does not respect AR validations and callbacks which could lead to poor data integrity. The best way is to use AR but make it run through multiple processes to boost up runtime. Details can be found on http://ruby-journal.com/how-to-import-millions-records-via-activerecord-within-minutes-not-hours/

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in