ActiveRecord sucks (English)*‎

Every Ruby developer knows an ORM named ActiveRecord.
It is so common, that it has even implementation on different programming languages, such as PHP.

At one hand, it is written in a way that truly understand Ruby, but on the other hand, it is written very badly. It is written so badly, that it has a lot of SQLi bugs inside, it uses too many resources to perform tasks, and the list just goes on and on …

If that was not enough, then it is very opinionated on how things would be created, even on places that you need different level of thinking, it does not provide it on it's own, and you find yourself write stored procedures that implement them, or functions for triggers instead.

I mostly use Ruby "clean", that is not writing any web based application, and on one of the non web program that I wrote, I needed to go over million records per day (not literally a day, but day in BI), and I find that after 200 requests for records, it opens too many connections to the database, even though it has a limit for "only" 120 connections for it's connection pool, but when I decrease it for 50 connections, it claims that it does not have enough connections to use.
Even an hour of inactivity, it does not release it's connections back, even though it has a "timeout" of 30 seconds to release it.

It ignores my timeout settings, it just take more resources, but does not release them back, regardless of what I tell it to do. So it renders as resource hog, and you require to release the resources "by hand" rather then do it's job right.

I found, many complaints about it on the web, and even few bug fixes, that didn't really fixed anything as I can see in real life situation, even when going to the last stable release of it.

S I started looking at other ORM for Ruby (and there are others as well), and it looks like a problem only with AR so far.

* This is a translation that was requested by few people for the original Hebrew post.

להשאיר תגובה

הזינו את פרטיכם בטופס, או לחצו על אחד מהאייקונים כדי להשתמש בחשבון קיים:

הלוגו של

אתה מגיב באמצעות חשבון שלך. לצאת מהמערכת /  לשנות )

תמונת גוגל

אתה מגיב באמצעות חשבון Google שלך. לצאת מהמערכת /  לשנות )

תמונת Twitter

אתה מגיב באמצעות חשבון Twitter שלך. לצאת מהמערכת /  לשנות )

תמונת Facebook

אתה מגיב באמצעות חשבון Facebook שלך. לצאת מהמערכת /  לשנות )

מתחבר ל-%s

אתר זו עושה שימוש ב-Akismet כדי לסנן תגובות זבל. פרטים נוספים אודות איך המידע מהתגובה שלך יעובד.