Your files have an affinity, for example controller.server.js has the affinity "server". This means that this file can and will only execute on the server. Now if you have a MySQL DB that can only be accessed from your server, you can only do so in files with a server affinity. If you want files with a common affinity, means that they can run anywhere, then you have to find another way, probably an HTTP key-value store that can be accessed "from the internet", that could be used to store your data.