In this bonus episode of the Technology for Humans podcast I was able to catch up with Joel Drapper.
Joel has been working hard to understand the recent situation and confusion surrounding Ruby Central, and has been keen to open the communication channels as much as possible to help resolve it.
I wanted to invite him on to the podcast because I feel that more communication is always better than less. And, as Joel points out in the interview, we are all here for the right reasons and want what is best for our community.
Of course the intention here is not to further antagonise or spread upset, but to help clarify.
While his thoughts may not be shared by everyone, it is worth understanding his view and decide what should be addressed by all sitting down together.
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.
2. Outdated Dependencies
If your application is running outdated versions of Rails or gems it can leave you exposed to security vulnerabilities and compatibility issues.
How to fix it:
Regularly run bundle outdated to identify outdated gems.
Schedule periodic updates and test them thoroughly in a staging environment before deploying to production.
Monitor the release notes of critical gems and Rails itself to stay informed about important changes.
What to watch out for:
Some gem updates might introduce breaking changes. Ensure your test suite is comprehensive to catch any issues early.
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)
The Bad!
1/The App that had just one line in the readme file: “todo: fill this in”
2/“We don’t own the github repo - you’ll need to talk to our developer about that”
3/Production database credentials in plain text in the code
4/“We just use the production database for testing”
5/Rails 2.x