Streaming Data From Postgresland to Rubyland
I recently gave a talk covering find\_each
, pluck
, and the PostgreSQL Cursor gem for the West Michigan Ruby Users Group.
Optimizing Rails for Memory Usage Part 4: Lazy JSON Generation and Final Thoughts
Code to copy-paste so you can lazily serialize JSON and maybe even stream it to the client, and an argument for why we shouldn’t have to do any of this.
Optimizing Rails for Memory Usage Part 3: Pluck and Database Laziness
Some ways to reduce memory usage as you gather records out of your database into Rubyland.