You can run the same uplink script that runs the same functions multiple times, on the same machine or on different machines. Each script connects to the server, registers the callable functions and waits for server calls. The server will randomly pick one of the uplinks every time it calls a function.
You can have 3 machines, each with 3 identical uplink scripts, and the server can call 20 of them concurrently. They will be randomly distributed, some scripts will run the function in different threads.
You can also append a suffix like the machine name to the function name when the functions are registered. This allows you to explicitly pick the machine you want.
I have 3 windows 10 machines with identical configuration. Each has 4 uplink scripts. Three of them do quick jobs that can run in parallel and use the random load balancing, which means that there could be many functions running at the same time on multiple threads. The fourth script preforms slow jobs that can last hours, uses cad, cam and other Windows applications that can only have one instance running per machine. This script appends the machine name to the function names, so the server can pick a specific instance.
They have been running for years and they were always able to reconnect after communication problems or after Anvil outages, with the exception of only one day. Windows and Excel instead refused to run many times and required some reboot and reconfiguration (and several times the updates were backward incompatible and required me to change the code). (I use Windows 10 instead of server or Linux because I need CAD, CAM and other applications that only run on Windows 10 with a user logged in.)
You can use the Secrets service:
password = anvil.secrets.get_secret('dedicated_db_password')
The business plan does have the persistent server option! (I thought it was only available on the dedicated plan.)
It does have the persistent server option, but doesn’t have a dedicated server.
We do have the dedicated server, and all I did was talking with the Anvil team and deciding what type and size we need. Then they did the initial configuration and take care of maintenance and upgrades. I don’t even have (and don’t want) access to it.