Take a look at this Rails gem, <a href="https:&#x2F;&#x2F;github.com&#x2F;mixonic&#x2F;ranked-model&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mixonic&#x2F;ranked-model&#x2F;</a><p>It&#x27;s a bit more efficient than traditional ordering...<p>From the readme:<p>ranked-model is also optimized to write to the database as little as possible: ranks are stored as a number between -8388607 and 8388607 (the MEDIUMINT range in MySQL)