MySQL or VFP database
MySQL or VFP database
(OP)
Hello colleagues!
Ten years ago I bought the book "MySQL Client-Server Applications with Visual FoxPro", published in 2007.
I have an application in VFP 9, using program (EXE) and files (DBFs) in the same folder. Many users access them in the server through PC terminals.
Now I am going to put the application in the cloud. So, I understand I have to make a change: only the database files will be in the cloud and every PC terminal accessing the files (using Windows Remote Desktop connection) will have the application file installed (EXE).
May I use the book to change my DBFs file to MySQL, or is it not a good approach anymore?
Or is the VFP database good enough for the cloud?
Ten years ago I bought the book "MySQL Client-Server Applications with Visual FoxPro", published in 2007.
I have an application in VFP 9, using program (EXE) and files (DBFs) in the same folder. Many users access them in the server through PC terminals.
Now I am going to put the application in the cloud. So, I understand I have to make a change: only the database files will be in the cloud and every PC terminal accessing the files (using Windows Remote Desktop connection) will have the application file installed (EXE).
May I use the book to change my DBFs file to MySQL, or is it not a good approach anymore?
Or is the VFP database good enough for the cloud?
Thank you,
SitesMasstec
RE: MySQL or VFP database
I'm not familiar with the book, so I can't comment in detail. But, in general, to take full advantage of a client-server architecture, you need to arrange things so that, as far as possible, all record selection is done on the server. This is a key point.
To give an example. In a typical DBF-based application, if you want to search a table for records that meet some criteria, yuo have to bring the entire table across the network, so that your app can examine each record in turn. You can mitigate that somewhat by using indexes, but that still involves bringing at least some data to your workstation in order to decide whether or not to keep it.
In a client-server application, on the other hand, the testing of the records is done entirely on the server, perhaps via the WHERE clause in a SQL SELECT. Only the records that meet the criteria are then sent across the network. Not only is this faster for your application, but it reduces network traffic in general, for the benefit of all users.
Clearly, you will need to re-design your app to achieve this. It's not just a question of replacing tables with remote views or cursor adapters. How difficult that will be will obviously depend on your existing design.
I hope this helps. If you care to tell us a bit more about your app, we can no doubt give you more specific advice.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro articles, tips and downloads
RE: MySQL or VFP database
It'll need more than just loading up the DBFs into the internet to have them available world wide. In short, you need a WAN (wide area network) to continue using DBFs.
MySQL is the easier solution to get data into the cloud, as any simple hosting is capable to run a MySQL server and thus have data "in the cloud" accessible from anywhere with internet connection. The hard part with this is as Mike said, you can't easily reuse your code to use a database server instead of DBF files.
The book you have is good enough, I guess, because VFP didn't change. You'll likely need to adapt things for newer MySL versions, as you shouldn't use an old server version.
Chriss
RE: MySQL or VFP database
This way, a user process the application (EXE) in the server located in the cloud and make all process there, so I will not need to make any change in the programs.
Indeed I had already done this to one of my applications, for testing, and it has worked fine and fast (using Windows Remote Desktop connection). Using a third-party framework I tested, I could even access the application from a browser!
Of course this isn't a client-server application, but what the problem if it works?
What is your opinion about this approach?
Thank you,
SitesMasstec
RE: MySQL or VFP database
I want to use VFP in the cloud in the same manner I have just seen in a post in a January post from Dan Olsson, a few minutes ago:
Thank you,
SitesMasstec
RE: MySQL or VFP database
This solution requires server hardware that can support as many as necessary parallel users aka usersessions and enough client licenses to connect.
Any normal Desktop Windows OS (say Windows 10 or 11) can allow Remote Desktop connections, too, and act as a server. But only for one user at a time. If that's enough you could just enable incoming remote desktop connections this way:
https://learn.microsoft.com/en-us/windows-server/r...
And overall, that's not at all a VFP related question anymore, but Windows administration about Terminal Server with requirements of hardware resources - mainly RAM and hdd space - and licensing.
Chriss
RE: MySQL or VFP database
As far as EXEs are concerned, there are certainly benefits to keeping them in the cloud (compared to having a copy on each local workstations) - not least of which is the ease of updating. But you will suffer a noticeable hit on performance. In a typical VFP application, the system is constantly accessing the bits of the EXE that it needs to execute, which means a lot more network traffic.
I'd go as far as to say that keeping a copy of the EXE on a local machine is one of the surest ways of improving overall performace of the application.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro articles, tips and downloads
RE: MySQL or VFP database
what you're saying is correct if think of it literally as SitsMasstec says as a folder in the cloud as if it was a file share and running the EXE would then run it locally like with a file share in the LAN having EXE and related files in it.
That's not practical, indeed, but also not what Dan Olsson did.
SitesMasstec, to get back to my post, I came back here to add to that. I said:
You can enable incoming remote desktop connections on each workstation of employees so they can use their actual workstation computer from home as a Home Office solution and then multiple users can use an application just like when they are in the office using their workstation, so this can work for multiple users, with the downside of each workstation needing to be on 24/7 to allow the connections to them at any time. Therefore usually a Terminal Server is used as a more practical solution.
Chriss
RE: MySQL or VFP database
I understood that Dan Olson access a server in the cloud from 50 different places across Sweden. I think those "50 different places" access the server through Windows Remote Desktop, aren't they?
I think every terminal must have VFP Support Library installed.
My application will be in a server in the cloud, and only 6 people from different locations will access the application. Sometimes 3 or 4 people will be using the same application at the same time. Is it not the same we do today in a LAN environment? Why Chriss says "one user at a time"? Just because of low speed?
Thank you,
SitesMasstec
RE: MySQL or VFP database
Reread, please. Just visit the link I gave you and you'd see for yourself. If you would enable remote desktop connections to a Workstation having a Windows version for clients (Win 8/10/11) and not a terminal server, you are limited to one user at a time.
If you use a Terminal Server, on the other hand, it depends on the server hardware ressources and client licenses what number of concurrent user sessions you can support. 6 users is not a big problem.
Chriss
RE: MySQL or VFP database
No, sorry you have misunderstood that
RE: MySQL or VFP database
May you please say how this (many users from different locations accessing the server) is done?
Terminal Server has to be installed in every terminal that access the Server (where de .EXE and DBF are stored) or just in the Server?
Until now I have applications being accessed in a LAN. Now I will have to put the server in the cloud.
Thank you,
SitesMasstec
RE: MySQL or VFP database
I run a couple of applications using RDP (Terminal Server) so that remote people can access them.
The server just has to have the role enabled, and licensing configuration established - along with enough client access licenses
to support what you want to do.
I strongly suggest you read this, to get yourself going.
https://www.slashadmin.co.uk/how-to-setup-a-single...
The client machines will most likely have RDP installed and they are easy to configure.
RDP is a favoured attack vector for windows servers (as they already know the name of one user
'Administrator'), so it is normal to limit the access via the firewall to just the required
IP addresses - or to use a VPN.
I have customers who have local networks who are happy to run my apps via RDP on my (rented)
servers, and I also have customers who use this approach for their remote workers and
as a 'last ditch' fallback in the event of their offices burning down or their being a worldwide
epidemic...
Regards
ing
Griff
Keep
I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
There is no place like G28 X0 Y0 Z0