Reading Roundup: Rails Performance and Developer Experience
Small technical wins that compound into better Rails apps
Hey there,
This week’s reads are all about working smarter with the tools you already have. From speeding up databases to writing cleaner Ruby code, these articles show how small technical decisions compound into better apps and happier development workflows.
Implementing OAuth in Hotwire Native apps with Bridge Components A detailed walkthrough showing how to handle OAuth authentication in Hotwire Native mobile apps using bridge components and system browsers instead of blocked webviews.
Read here
Performance-Optimized Video Embeds with Zero JavaScript Using native HTML <details> and <summary> elements to lazy-load video embeds only when users interact, delivering 14% faster load times and 2.5× less data transfer than lite-youtube.
Read here
Teach your models to act, not just be A refactoring lesson on moving business logic from controllers and background jobs into the models themselves, making code more maintainable by teaching models verbs like start!, poll!, and finish!.
Read here
Speeding Up PostgreSQL Full-Text Search with Persistent TSVectors How persisting PostgreSQL tsvectors in a dedicated column with GIN indexing eliminated sequential scans and achieved a 118× speedup (from 283ms to 2.4ms) on full-text search queries.
Read here
Prefer in? Over include? for Readable Conditions Rails’s in? method reads more naturally than Ruby’s include? by putting the subject first, turning array.include?(item) into the more intuitive item.in?(array).
Read here
Quick notes and actionables
Persist computed values for performance: If you’re computing tsvectors, embeddings, or any expensive transformation at query time, consider storing the result in a dedicated column with the right index type (GIN for tsvectors, vector indexes for embeddings).
Use platform features before reaching for libraries: The
<details>/<summary>pattern for lazy-loading embeds shows that modern HTML can replace custom JavaScript solutions while improving performance metrics across the board.OAuth in mobile webviews is blocked: If you’re building hybrid mobile apps with Hotwire Native or similar frameworks, plan for OAuth to happen in system browsers with custom URL scheme callbacks—webviews won’t work with major providers.
Put behaviour where the data lives: When refactoring Rails apps, look for opportunities to move orchestration logic from controllers and jobs into models as action methods. The code reads better and changes become safer.
Small readability wins add up: Using
candidate.in?(nsync)instead ofnsync.include?(candidate)is a tiny change, but these readability improvements accumulate across a codebase and make code reviews faster.Read beyond the quick start: Performance issues often appear only at scale. When integrating gems or frameworks, take time to read the full documentation—critical details like persistent tsvectors or index strategies are usually documented, just not always in the getting started section.
Just sharing a few reads I found useful. If one of these sparks something, I’d love to hear what you build or how you adapt the ideas
