Apps don't persist monolithically. Each time a request is made to your app domain, a new server process based on your main.js will be spawned if one doesn't exist already, or if all existing processes are busy. Once spawned, processes persist until they are no longer needed.
So, you should not use main.js to persist anything that you wouldn't want to lose or have in an inconsistent state, including HTTP session data. The database (
http://www.akshell.com/docs/0.3/guide/db/) should be used for that (at the moment).
The only types of variable to store in main.js are ones that are process specific that need to be initialized once. Say you had locale strings in a text file in a key=value format and you wanted to store them inside the app as a JSON object, rather than parsing them on every request. They could be lazily loaded in main.js and stored as a variable. That way when a new process is spawned, it would lazily reinitialize the JSON object in exactly the same way, ensuring consistency across processes.
Oleg