I'm pretty new to php, I've built a couple of simple personal projects, now I'm ready to tackle a bigger project. I find that a project with challenge is the best way to get me to learn new concepts. Now, on to why I need some help.
I need a database(I'm using mysql, running on OS X) that will store nodes linked in a circular fashion. Basically I want to be able to have a large number of nodes in the circle(up to 10k possibly). I've taken data structures courses in college so I know about linked lists and doubly linked lists and thought about implementing it that way, but I want to be able to compare two nodes on opposite sides of the circle, and traversing through the linked list with 5k database accesses doesn't seem very efficient. I need to be able to add and remove nodes at any place in the circle, and have them shifted by user input. I'm sure there's a fairly simple way to go about this, I'm just not sure as to what it would be. What would the most efficient way to go about setting this up?