How do Asana arrange its task?


I am curious to know how asana is so fast and store task in database. For example i can arrange the task according to my order. How do you store the data in same order in which i store it. Like i created a task and move it on 5th position. And if i restart asana after 3 days, that task are still on that 5th position.