Associations provide a higher level of abstraction for your app. How
does
adding new methods affect performance?
You can optimize slow queries with multiple joins by using sql instead
of
ActiveRecord finders. There are also other techniques to speed up the
app.
As a beginner I would not worry.
As one of my incompetent manager used to say: “Code like a wind”. LOL.
so the user was created by a user … and the last modification be done
by another user … then each user reports to one user … moreover the
users have friends, send messages, write blog entries, etc.
would you really add for all this own associations? also e.g. for
creator and updater - which are e.g. only used on one place?
i also load the current logged in user on each request … would this
affect performance if more associations are here?
i am just wondering, because the project is expecting to have 10.000
uniques a day.
so the user was created by a user … and the last modification be done
by another user … then each user reports to one user … moreover the
users have friends, send messages, write blog entries, etc.
would you really add for all this own associations? also e.g. for
creator and updater - which are e.g. only used on one place?
probably
i also load the current logged in user on each request … would this
affect performance if more associations are here?
Having an association or not isn’t going to affect the loading a
single record
i am just wondering, because the project is expecting to have 10.000
uniques a day.
Remember what they say about premature optimization ?
it could lower the performance of my application (because
new methods are added to the models which are not all necessary for me
Just to be clear, the number of methods in a class has neglible impact
on performance, so I think your concerns about associations are maybe
based on a false premise.
///ark
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.