Contact us: info@railsfactory.com
Phone : +91 96000 RAILS (72457)

convention over configuration

Posted by senthil
on Monday, August 25
when we embraced Rails couple of years back, the one feature which we loved was convention over configuration. which made getting started very easy.

but many times the convention may be good for most users but for many large applications these are just training wheels, which must me optimized in production for the problem/bottleneck the app faces

ActiveRecord cache preference
for one project we have noticed significant memory increase, which we could attribute to ActiveRecord Caching. Thanks for good logging capability in Rails

ActiveRecord include preference
eager loading behavior has changed, it no more does big joins(unless it has dependents), this is based on feedback from many users, also possibly very true for mysql based startup apps.

but our app works with oracle and a large dataset, all db tuning and optimizations were done for rails 1.2 defaults. now suddenly we have hundreds of small query and when we add caching, lot more memory usage and slower performance.

ActiveRecord Dirty Tracking a very cool feature which can get performance improvements on update queries, but if you are upgrading a old app, and you use update_attribute in many places will need you to add
model_instance.attribute_name_will_change! .

a better solution would be either dirty tracking disabled(that is possible ) or Model.will_change or model_instance.will_change!

we have overridden these behavior and have solved our problems, but we believe these can be useful for other large applications as well

Background
RailsFactory is over 2 years old and we are amongst the most experienced Rails Teams around. Most of our projects are new development(including porting from other technologies), but recently we worked on a rails migration for a very large client application, which gave us insights on what enterprises want from ruby and rails.

ActiveRecord 2.x patches for submission

Posted by senthil
on Monday, August 25
I have submitted one ticket and patch to rails

checkbox generation with "false"

I plan to submit more patches in coming days

ActiveRecord::Base.sanitize_sql

sanitize sql is used for escaping custom sql built with user input.

behaviour has changed in rails 2 when compared to rails 1.2

Rails 2.1
>>ActiveRecord::Base.sanitize_sql("")
=>nil

Rails 1.2
>>ActiveRecord::Base.sanitize_sql("")
=>""


ActiveRecord cache preference
ActiveRecord include preference

will be adding description and ticket numbers soon

© 2004 - 2009 Railsfactory