Hi all. I am nearing the completion of my first web app, and I have been curious of two things. I am planning on deploying with Xojo Cloud in case that helps with my questions:
Could there by any issues with connecting to the MySQL db (I think cloud uses MariaDB, but I was told it’s basically the same) in a location where there might be firewalls? Little history on this one. I have a desktop app (the one I am converting to web) that currently uses MySQL connections through port 3306 for registering and saving student data. My customer base includes nutrition students and schools. I’ve found that when students are on campus or at their internship at the hospital, they sometimes cannot connect to the MySQL db because some public WiFis block certain connections. Find out, if they use the app on their home network, there is no problem since they’re not firewalling anything. Similar with some of the schools who have the software on campus for students. With the web app, could this still potentially be an issue where I will need to ask them to use the app when on their home network (kind of defeats the purpose of a web app) or to ask the school/internship to allow communication to the server? Or does the web app act differently where this would not be an issue?
When you work on an update to a web app and deploy through Xojo Cloud, what happens to the users who are already using the app when the update pushes? Does it automatically quit on them, or do the changes not take effect until they log out and back in again? I would be concerned if it quits while they are working in the app as they could be in the middle of a study session and instantly the app quits on them without warning.
Thanks! These are just two curiosities that have been on my mind lately
If you’re using the MySQL instance that Xojo provides, it’s on the same exact server so there’s nothing to get in the way.
When you deploy an update, it physically replaces the previous version. You may want to build in a mechanism to notify users of a pending update and give them a certain amount of time to log off before you deploy your new version.
Thanks for the info Greg! I’m happy to hear the firewalls shouldn’t be a problem
As for the notifications of a pending update, do you have any suggestions on how others do this as a best practice? I am thinking of a db table that would be checked every so often, and when I am ready to deploy, I would update a version number or something and can have it send a message to the user. This is just top of mind as I haven’t given this any thought until right now
When I’ve done this in my own projects, I have an administration panel where I log in and set a “pending update” mode. It sets a flag which is checked in App.HandleURL which automatically redirects users that are trying to connect (Request.Path = “”) off to another server or app temporarily which says that the app is down for maintenance.
If Request.Path = "" and mPendingUpdate Then
Response.Header("Location") = "url for maintenance page"
Response.Status = 302
Return True
End If
Then a message is sent out to any sessions that are currently running saying that the app is going down in xxx minutes and that the user should save their work and log off. The admin dashboard should show the number of active sessions.
Once the time is up, you deploy the newer version of your app. Because mPendingUpdate starts as False, users will be able to reconnect as soon as the new one is deployed.