A New Gem for Background Jobs from Ruby/Rails to Crystal/Mosquito

One of the ways I think we can help the adoption of Crystal is by showing how it can be slotted into existing workflows with what devs are comfortable with.

My background is as a Ruby/Rails dev and I currently work for a company that handles voter data for elections for a very large part of the US. One of the challenges we have is with the massive amount of data coming in large chunks (up to 10M+ records at a time) needing to be efficiently processed. Ruby just can’t keep up with bulk data like that and we haven’t found a workaround for these requirements from our customers.

Enter stage left: Crystal & Mosquito.

I’ve been able to trigger background jobs from Rails for a few weeks, so I decided to take my process and turn it into a gem. My hope here is that this makes it easier for others to experiment and try the same thing: integrating two languages.

The gem is called fruit_juice, because fruit juice attracts mosquitos ;)

https://rubygems.org/gems/fruit_juice

I plan to create more content around this so that it may inspire other devs out there to experiment and pave a smoother road to the adoption of Crystal.

15 Likes

Reminds me of waaay back when strugling with getting a PHP search page to correlate the results from the database at speeds that would be bearable for the user, I ended up writing a small Ruby HTTP server that just queried the database and sorted the results before handing it over to PHP. Turned out that Ruby could do it much faster.

Sometimes you just have to go to a tool better suited for the job.

2 Likes