Skip to content
whichdevtool?
Categories ▾

Frameworks and UI

Frontend and full-stack frameworks Backend frameworks UI component libraries

Hosting

VPS and cloud servers App hosting and PaaS

Data

Managed databases File and object storage ORMs and database toolkits

AI

AI model APIs

Email

Transactional email APIs Email marketing and newsletters

Payments

Payments and billing

Domains and edge

Domain registrars CDN, DNS and edge security

Operations and identity

Monitoring, uptime and error tracking Auth and identity Background jobs, queues and workflows
Stacks Directory
Ctrl K

Search directory
Menu
StacksDirectory Pricing changes Glossary
VPS and cloud servers App hosting and PaaS Managed databases Transactional email APIs Email marketing and newsletters Domain registrars CDN, DNS and edge security Monitoring, uptime and error tracking Auth and identity Frontend and full-stack frameworks Backend frameworks UI component libraries AI model APIs File and object storage Payments and billing Background jobs, queues and workflows ORMs and database toolkits
  1. Home
  2. ORMs and database toolkits
  3. Active Record (Rails)
AR

Active Record ORM for Ruby on Rails · by Ruby on Rails

Active Record (Rails)

The ORM at the heart of Ruby on Rails: convention-over-configuration models, associations, validations, callbacks and a Ruby migration DSL that keeps schema.rb in sync.

Visit guides.rubyonrails.org ↗ Alternatives Open source Open source Self-hostable
guides.rubyonrails.org
Active Record (Rails) homepage
§1

Overview

Active Record is the model layer of Ruby on Rails and an implementation of the pattern Martin Fowler described as an object that wraps a database row and adds domain logic. Models inherit from ApplicationRecord, map to tables by naming convention, and gain query methods (where, order, joins, includes), validations, callbacks and associations such as has_many, belongs_to and has_many :through, plus single-table inheritance.

Migrations are Ruby classes (for example ActiveRecord::Migration[8.1]) that describe schema changes with a database-independent DSL; running them updates db/schema.rb, which records the current structure. Generators create models and migrations together.

Because it follows convention over configuration, a Rails app needs very little mapping code, but it also means Active Record is designed for use inside Rails. Sequel is the main standalone alternative in Ruby.

Before you pick it, know what it is not: Active Record ties each model to one table and puts behaviour on the model, so business rules, validations and persistence live together. The Rails guides recommend reading the associations and migrations guides alongside the basics, and most of the query performance work in Rails apps comes down to using includes or strict loading to avoid N+1 queries.

§2

Pricing and plans

Plan Price What you get
Active Record $0 Part of the MIT-licensed Ruby on Rails framework

Free and open source as part of Rails; there is no paid product.

Source: guides.rubyonrails.org/active_record_basics.html · prices as published, excluding tax.

§3

What it does

Convention over configuration
Table, key and column names follow Rails conventions, so models need almost no mapping code.
Associations
belongs_to, has_one, has_many, has_many :through, has_and_belongs_to_many and polymorphic associations.
Validations and callbacks
Declarative validations and lifecycle callbacks run before and after saves.
Query interface
Chainable where, order, joins, includes and scopes that build SQL lazily.
Migrations
Ruby DSL migrations with reversible change methods; db/schema.rb reflects the result.
§4

Strengths and limitations

Strengths

  • Extremely fast to build with inside Rails
  • Mature, with decades of production use and extensive guides
  • Migrations and schema file kept in step automatically
  • Large gem ecosystem built around it

Limitations

  • Designed for Rails; using it standalone is uncommon
  • Callbacks and fat models can make large codebases hard to follow
  • N+1 queries appear easily without includes or strict loading
  • Models are tied to the database schema, as the Active Record pattern implies
§5

Who it suits

Good for

  • Ruby on Rails applications
  • Startups that want to ship CRUD features quickly
  • Teams already fluent in Rails conventions

Look elsewhere if

  • Non-Rails Ruby services (Sequel fits better)
  • Domain models that need to stay independent of persistence
§6

Alternatives to Active Record (Rails)

Tool From Free option Stages
EO
Eloquent ORM Active Record ORM for Laravel
— Open source
SQLAlchemy Python SQL toolkit and ORM
— Open source
EF
Entity Framework Core .NET ORM
— Open source
Da
Dapper .NET micro-ORM
— Open source
Prisma ORM Schema-first TypeScript ORM
$10/mo Free tier
TypeORM Decorator-based TypeScript ORM
— Open source

All ORMs and database toolkits →

§7

Questions

What is Active Record in Rails?

It is the Rails ORM: models that wrap database tables and add associations, validations and callbacks.

How do migrations work in Rails?

Migrations are Ruby classes that change the schema through a DSL; running them updates db/schema.rb.

Can I use Active Record without Rails?

Yes, the gem can be used on its own, but most documentation and tooling assume a Rails app.

Sources read for this page

  • https://guides.rubyonrails.org/active_record_basics.html
  • https://guides.rubyonrails.org/active_record_migrations.html
Spec sheet
From
Open source
Free tier
Free to self-host
Stages
HobbyIndieStartupScale-upEnterprise Suits hobby, indie, startup, scale-up, enterprise
Language
Ruby
Approach
Full ORM (Active Record)
Databases
SQLite, MySQL/MariaDB, PostgreSQL; more via gems
Migrations
Yes, Ruby DSL migrations with schema.rb
Open source
Yes
Self-host
Yes
EU data
Not stated
Category
ORMs
Visit guides.rubyonrails.org ↗

To report an out-of-date price or limit, use the correction form.

whichdevtool?

Developer and cloud tools compared on price, free tier and limits, each with its source. For side projects, solo developers and small teams.

Categories

  • VPS and cloud servers
  • App hosting and PaaS
  • Managed databases
  • Transactional email APIs
  • Email marketing and newsletters
  • Domain registrars
  • CDN, DNS and edge security
  • Monitoring, uptime and error tracking
  • Auth and identity
  • Frontend and full-stack frameworks
  • Backend frameworks
  • UI component libraries
  • AI model APIs
  • File and object storage
  • Payments and billing
  • Background jobs, queues and workflows
  • ORMs and database toolkits

Research

  • Directory
  • Stacks by project
  • Developer news
  • Pricing changes
  • Glossary

Site

  • About and methods
  • How we make money
  • Suggest a tool or fix
  • Privacy
© 2026 whichdevtool.com Prices change. Each tool page links to its source. We may earn a commission when you sign up through links on this site. How we make money