I would not have thought that they would do this often enough to be a serious problem, but if you are worried, use the trick that we started with our BASIC code from a few days.
Back when BASIC had line numbers, we just counted them 10, 20, 30, etc. so that if we needed to insert one between 10 and 20, we would call it 15. Or if 20 should have up to 10 , we renumbered it to 5.
With a 32-bit integer column, you can have 200,000 friends at intervals of 100, more than enough to move things around, especially if you're smart.
You might want to start the swap job to renumber your friends to 100, 200, etc. (for example, disk defragmentation for your social network). Do not try to find this by looking at the friends numbers, use another field, setting it to true when the user re-arranges his friends and clears it when defragmenting. It will be more efficient.
source share