Backend Framework Deep Dive

Ruby on Rails

The framework that defined "convention over configuration." Twenty years on, Rails still ships full-stack web apps faster than almost anything else — and powers GitHub, Shopify, and Basecamp.

RubyMVCConvention > ConfigFull-stackIconic
← Back to Server Side
Quick Facts

At a Glance

Language
Created
2004 · DHH (Basecamp)
Pattern
MVC + ActiveRecord
Style
Convention over configuration
Latest
Rails 8.x
Notable users
GitHub, Shopify, Airbnb (early), Hey

Basic Concepts

  • MVC: Models (data), Views (HTML), Controllers (request handlers) — the original web MVC for Ruby.
  • ActiveRecord: the ORM — each class maps to a DB table, instances to rows.
  • Convention over configuration: follow Rails' naming, get behavior for free.
  • Generators: rails generate scaffold Product name:string price:decimal creates model, controller, views, migration, tests.
  • "Omakase" stack: opinionated defaults from Hotwire frontend to Action Mailer.
Syntax

Taste of Rails

# app/models/product.rb
class Product < ApplicationRecord
  validates :name,  presence: true
  validates :price, numericality: { greater_than: 0 }

  scope :affordable, -> { where("price < ?", 100) }
end

# app/controllers/products_controller.rb
class ProductsController < ApplicationController
  def index
    @products = Product.affordable.order(created_at: :desc)
  end

  def create
    @product = Product.new(product_params)
    @product.save ? redirect_to(@product) : render(:new)
  end

  private

  def product_params
    params.require(:product).permit(:name, :price)
  end
end
Mechanics

Key Features

ActiveRecord

Pythonic-readable Ruby queries, automatic migrations, associations (has_many, belongs_to), validations, callbacks. The most expressive ORM in any language.

Hotwire (Turbo + Stimulus)

Rails' modern answer to SPAs without writing much JavaScript. Turbo swaps page fragments over WebSockets; Stimulus sprinkles minimal JS behavior. Powers Hey and Basecamp.

Active Job, Action Mailer, Action Cable
  • Active Job — background jobs (Sidekiq, GoodJob).
  • Action Mailer — sending emails as easily as rendering views.
  • Action Cable — built-in WebSockets.
  • Active Storage — file uploads to S3 / GCS / Azure.
Modern Rails (7 / 8)

Rails 7 brought ESM-friendly asset handling (importmap-rails) and Hotwire defaults. Rails 8 adds Solid Queue / Cache / Cable (DB-backed alternatives to Redis) and Kamal for one-command deploys.

Ecosystem
GemPurpose
DeviseAuthentication.
Pundit / CanCanCanAuthorization.
SidekiqBackground jobs.
RSpec / MinitestTesting.
Pagy / KaminariPagination.
Trade-offs

Strengths & Weaknesses

Strengths
  • Unmatched velocity for full-stack web apps.
  • Cohesive, complete framework — minimal decision fatigue.
  • Hotwire reduces SPA complexity drastically.
  • Mature, security-conscious, well-documented.
Weaknesses
  • Smaller hiring pool than the 2010s peak.
  • Performance trails Go / Java for raw throughput (improving with YJIT).
  • Heavy magic — fighting Rails is painful.
  • Boot time can be slow on large apps.
Where It Shines

Sweet Spots

SaaS & Marketplaces

The original Rails sweet spot — Shopify is the largest example.

Internal Tools / Admin Apps

Scaffolding gets you to "working CRUD" in minutes.

Solo & Small Team Startups

One-person Rails app + Hotwire scales surprisingly far.

Content Sites

Mature gems for blogs, e-commerce, CMS.

Continue

Other Backend Frameworks