Forward: This post is mainly copypasta from an answer I wrote on StackOverflow. It also takes into account the version of Mongoid being used predates the includes method. The includes method being the suggested best practice for the problem now. includes will be mentioned at the bottom of the post.
Take me to the current best practice.
How to deal with n+1 issues utilizing identity maps:
What is the n+1 issue?