Home / Companies / Lago / Blog / Post Details
Content Deep Dive

ORMs are criticized for the wrong reasons

Blog post from Lago

Post Details
Company
Date Published
Author
Finn Lobsien
Word Count
1,264
Company Posts That Month
2
Language
English
Hacker News Points
-
Post removed?
No
Summary

Object-Relational Mappings (ORMs) are often criticized for being inefficient and breaking software design principles like the Single Responsibility Principle (SRP) and Separation of Concerns (SOC), yet these criticisms are considered exaggerated by the author. ORMs are not inherently bad; they are simply abstractions that can lead to performance hits and decreased visibility if misused. The primary issues with ORMs include the N+1 query problem, where multiple roundtrips to the database occur, and challenges with visibility and error translation, especially when unexpected results require inspection of the SQL queries generated. Despite these drawbacks, ORMs can be nearly as efficient as raw SQL when used correctly and offer features that can mitigate common issues like N+1 scenarios. The author's experience with Active Record prompted a reevaluation of ORM usage, noting that developers often rely too heavily on host language logic instead of utilizing ORM features to optimize queries, and suggesting that executing raw SQL queries within an ORM can sometimes be beneficial for debugging or improving performance.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.