For example just on the server to save the variables as global and domestic service as he wants and keeps it.
Global variables are bad. Can use any key-value store.
Is there a way to completely disengage from the databases?
You need a Data Mapper + repository + unit of work. Alas, I don't know of such implementations in JS. There is js data but I'm not sure it will solve your problem. In Java/.NET/PHP world there is solyusheny like Hibernate/nHibernate/Doctrine which all have out of the box but it's not a simple solution.
In General, it is sufficient to "lock" working with databases in some objects repository, which will resolve everything for you, from the outside and you will find that everything is stored in memory.
I remembered the little project: https://github.com/Breeze