Q:

Order matters database item

Trying to setup a database where it has a table with a bunch of devices, but when displaying the devices order matters. I would need to be able to insert/delete devices in any part of the chain. We may have to end up adding Device X between Device C and Device A; not necessarily after Device Z. 
Essentially a linkedlist of devices. 
device-pool table
id | device_id | next_device
this would easily work, considering you would only need to know the start_device which is stored separately. My question is, is it possible to do this with sales force? 
Another idea would be
device-pool table
id | device_id | device_order | pool_id
devider_order would be a multiple of 10. -1 to insert device behind it, +1 ahead of it.
Any other ideas / how-to execute either of these ideas?
solution 
We ended up not using the order list, or implement this feature for that matter. Although, I did get part way through the problem. What I did was assign a field next (points to the next object) and then have a field position. There's another field which ties it to the container (e.g, the pool). Created a custom trigger. Field position was 10,000 if next was null. Upon inserting a new object, it would grab the next id, find who previously points to it (if NULL this is okay), and do (Next_Pos - Pointer_Pos) / 2 for the position numeric. The assign Next to go to the new object (after insert), and voila! Now all you have to do is order by position and you're done!

A:

We ended up not using the order list, or implement this feature for that matter. Although, I did get part way through the problem. What I did was assign a field next (points to the next object) and then have a field position. There's another field which ties it to the container (e.g, the pool). Created a custom trigger. Field position was 10,000 if next was null. Upon inserting a new object, it would grab the next id, find who previously points to it (if NULL this is okay), and do (Next_Pos - Pointer_Pos) / 2 for the position numeric. The assign Next to go to the new object (after insert), and voila! Now all you have to do is order by position and you're done!

