We're in the process of implementing drag & drop in our platform to reorder elements and while the UX is straightforward to manage I've seen a lot of options for persisting the order in DB.
I'd love to get some wisdom from the community and see what the best practices are. I've looked around on StackOverflow and found this article that has an interesting option to limit queries.
So, in your experience, what's the best approach for it?
Edit: for those stumbling on the post look at Guillaume's comment for neat SQL statements.





Generally speaking, for a drag an drop list, the number of elements you're working with is going to be small enough that reordering the list with a
ordercolumn should be fine. If you have so many elements that you're needing to paginate the list, then drag and drop doesn't really make sense (how do you move an item between pages?). The code is pretty straightforward too,select *, then when go to save, just iterate through the list and set its order to the iteration index and save.