In edge rails, serialized attributes are saved every time no matter they are changed or not: def update_with_dirty if partial_updates? # Serialized attributes should always be written in case they've been # changed in place. update_without_dirty(changed | (attributes.keys & self.class.serialized_attributes.keys)) else update_without_dirty end end
In out app, User model has a serialized attribute friend_ids, which is the id array of the user's friends (used to be a friendships table, but when that table grew to tens of millions of records, we refactored it to a User's attribute). The User model in our app is saved very frenquently, and many users have more than 1 handred friends, so the friend_ids may has 1kB long. Some of my colleages opposed to use serialized friend_ids, and suggested to used a comma separated string instead because saving 1kB each time would have performance issue. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---