ActiveRecord ORM Debate

Cluster centers on debates about Ruby on Rails' ActiveRecord ORM, questioning if it's an anti-pattern, praising its ease for simple cases, criticizing it for complex queries, and comparing to alternatives like Ecto or raw SQL.

📉 Falling 0.3x Databases
1,821
Comments
20
Years Active
5
Top Authors
#7805
Topic ID

Activity Over Time

2007
9
2008
34
2009
58
2010
138
2011
130
2012
140
2013
101
2014
137
2015
79
2016
133
2017
60
2018
74
2019
121
2020
130
2021
92
2022
101
2023
117
2024
103
2025
63
2026
1

Keywords

JS OO SQL store.rb ORM RAW IP AR DBAL TCP activerecord rails orm sql ar active record ruby database pattern

Sample Comments

extasia Aug 14, 2023 View on HN

What's Active Record and why is it an anti pattern?

lxe Jun 18, 2021 View on HN

Have you tried Ruby on Rails' ActiveRecord? I like it! It's easy to use and easy to integrate with "raw sql" if needed.

dools Jun 6, 2012 View on HN

Which, really, should be "ActiveRecord is an anti-pattern"

reillyse May 15, 2025 View on HN

Every ORM except Active Record is awful. Active Record is amazing.

aantix May 24, 2016 View on HN

Any specific code examples you'd like to share where you thought ActiveRecord was inferior to the alternative you provided?

sethrin Jun 15, 2023 View on HN

There are very few situations where you'd need or want ActiveRecord to step out of the way, and in general Rails does a lot more for you.

Isn't this exactly what Active Record in Rails does?

vectorpush May 23, 2016 View on HN

ActiveRecord is terrible for any kind of complex database work. If your data models are simple or you decide to shoehorn your entire data model into an "object" representation then ActiveRecord will allow you to work, but if you need to run queries like "return every product that represents less than 2% of total revenue for the last year excluding products purchased by our top 10 most profitable clients" ActiveRecord is going to give you a very inefficient solution where you&

freedomben Dec 4, 2023 View on HN

Have you worked with ActiveRecord or Ecto? Just wondering for framing your comment

Alifatisk Feb 28, 2024 View on HN

Reminds me of how ActiveRecord works in Rails