Can webflow pull data from the database and assign it to global js variables in real time when the data values from the database change?
Nope. Not a current feature on the platform. You may want to consider using an API that does.
Look into Wized. It may have AJAX subscription hooks that allow your application server to push updates to your active browser clients.