Tech CEO @reinteractive, Ruby on Rails, Heroku and real world AI. Building the best Rails dev company in the world with the best technologies and best people
May 9 • 7 tweets • 3 min read
Aftewr several years in building and mainting apps for enterprise clients, here are the top 5 things we learnt (from Kane Hooper, COO reinteractive)
1. The N+1 Query Problem
What’s the issue?
The N+1 query problem comes about when your application makes one query to fetch a set of records and then makes additional queries for each of the associated records. This can cause performance bottlenecks, especially as your data grows.
How to fix it:
Use Rails’ includes method to eager load associations, reducing the number of queries.
For example:
posts = Post.includes(:comments)
This approach ensures that comments are loaded alongside posts, minimizing database hits.
What to watch out for:
Be cautious with nested associations and ensure you’re not loading unnecessary data. Tools like the Bullet gem can help detect N+1 queries during development.
Mar 14 • 6 tweets • 2 min read
reinteractive delivers a comprehensive App Review for Ruby on Rails. Needless to say over the years we have found some incredible things here are my top 5 good and bad (all real examples for production apps!) (a thread)
The Good!
1/An overwhelming majority of apps we review score greater than 80 on Ruby Critic test
2/a 90% test code coverage (yet to see the fabled 100%)
3/A readme so through that a new dev is able to spin up the local environment including complex dependencies measured in minutes
4/“We’ll just finish off the 7.x upgrade before you start your review”
5/"We just wanted an independent opinion on how our developers are going" (bonus points when those developers are present in your report delivery meeting and they engage like a group pairing session)