Thoughts on having a sorted, modifiable list in MySQL
I had a discussion with a colleague on how to persist a sorted (linked?) list in MySQL, and would like to write down my thoughts on this since this is likely a problem I will face in the future. There must be a better way of thinking about this than I’ve come up with. If you have an idea, don’t hesitate to send me an email. Problem description We have a sorted list of a generic length. It should be possible to reorder the items in a generic fashion (e.g you can drag and drop the items to change the list order from the GUI). This means supporting both swapping items and inserting items between two existing items. Then list should also gracefully handle growing and shrinking. ...