Connecting nodemcu through internet
It is a bit difficult to address local device from the internet due to the protection provided by the firewall. 

There are may ways to solve this problem (i.e. opening a port on the router, creating a server to address queries coming from the internet etc.). 

I use Firebase as an external database and make my NodeMCU such that it listens to changes on the Firebase real time database.


You can integrate firebase with your website and using the website you can update database values.
Whenever a value is changed the NodeMCU will respond to it.
Example code for the same can be obtained from the internet. There are many tutorials, videos on this topic which you can go through.