βΆIs Rails dead? Why choose Rails over Node.js or Django in 2026?
Rails is not dead β it's mature. Greenfield adoption has declined (Node/Python growing), but Rails powers 2M+ production apps. Choose Rails for: rapid MVPs, SaaS products, teams prioritizing speed-to-market, existing Rails monoliths, Ruby's elegance. Skip Rails for: real-time systems (use Node), machine learning (use Python), or distributed microservices (use Go/Rust). For startups, Rails remains the fastest path to revenue.
βΆWhat is Hotwire (Turbo + Stimulus) and when should I use it?
Hotwire brings modern UX to server-rendered Rails without JavaScript complexity. Turbo replaces Turbolinks: AJAX page updates, prefetching, morphing. Stimulus provides lightweight interactivity (modals, dropdowns, carousels) without a heavy SPA framework. Use Hotwire when: building traditional Rails apps but want fast, snappy UX. Skip it when: building a single-page app (use React/Next.js) or real-time collaboration (use WebSockets + Node).
βΆShould I build a monolith or microservices with Rails?
Monolith first (95% of startups should). Rails monoliths scale to billions of requests (GitHub, Shopify). Microservices = premature complexity; split only when: single team can't own one codebase, scaling bottlenecks emerge, or domain boundaries are clear. Most Rails refactors fail because they start with services. Extract a service when you have data to prove it, not before.
βΆWhat are ActiveRecord pitfalls and how do I avoid N+1 queries?
N+1: fetching related records in loops (e.g., `@users.each { |u| u.posts.size }`). Fix: eager-load with `.includes(:posts)` or `.left_outer_joins(:posts)`. Monitor with tools like Bullet gem in dev. Other pitfalls: missing indexes (use `explains`), overfetching columns (use `.select`), large transactions, and callback hell. Solution: indexes, eager loading, service objects, database query profiling.
βΆHow do I handle authentication and authorization in Rails?
Standard gems: Devise (authentication, sessions, password reset) + Pundit (authorization, policy objects). For APIs: Devise-JWT or token-based auth. For simple apps: build auth yourself (Rails has `authenticate_with_password` helpers). Avoid: rolling your own crypto; use Devise. For OAuth (Google/GitHub login): use omniauth-google2 or similar. Multi-tenant: add account_id to all models, use Pundit policies to scope by tenant.
βΆWhat performance optimizations matter most in Rails?
Top 3: (1) Database indexes β query profiling finds 80% of bottlenecks. (2) Caching β Redis + fragment/page caching, cache_key versioning. (3) Background jobs β move slow work to Sidekiq. Measure: New Relic/Datadog for APM, Bullet for N+1, rails_panel in dev. Avoid premature optimization; profile first, optimize second.
βΆWhat is the Rails hiring market like?
Demand: strong. Salaries: $120-170k mid-level (vs. $140-180k Node). Growth: slower than Node/Python, but steady. Best opportunities: startups (rapid growth), SaaS (established), agencies (contract work). Junior Rails roles scarce (everyone wants mid+, less bootcamp pipeline than JavaScript). Best path: freelance β SaaS team β lead engineer. Rails skills = senior title faster (5-7 yrs vs. 8-10 yrs for Node).