RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

How to Process Large Data Sets with Ruby

The need for data migrations in mature systems is real. At times, requests for these migrations can appear at random. One minute, a system is behaving as specified, happily fulfilling requests, and then bam! All the user objects suddenly need an extremely crucial attribute. Find out how to do such a data migration in a fast and efficient way.

Comments

I think by far the best way to handle this is using some simple (Postgre)SQL:

rb User.update_all("phone_number = '+1' || phone_number")

This is now several orders of magnitude faster and you shouldn’t need any background jobs.

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