Looking at Tony Andrew's and Mark's answers in particular, it seems I really have only two alternatives:
- Saving a 'next' value, making the objects behave like a linked list (see Mark's answer)
With this, changing the order is cheap, but I'd have to retrieve the items and then sort them by their 'next' value, which is expensive
- Saving an 'order' value (see Tony Andrew's answer)
This makes retrieving cheap but saving a new order potentially expensive, because in the worst case, I'd have to change all the order values. cletus points out that one could use a large number in the form of 2^n for the order multiplier.
Meta: All of these answers are good and correct, which one should I choose as correct?