I have an app hosted on Shinyapps (Basic plan) that never has more than 3 users at time, which sometimes needs to run some quite time-intensive tasks. These tasks have already been parallelised and optimised for speed.
The issue I have I believe stems from R's single-threaded design. When one of the users is running one of the time intensive tasks (which can take up to 10mins) the other users have to wait around before this task is finished before their more simple tasks are resolved. To them, it just seems like the app has crashed.
If I understand things correctly, I therefore need to find a multi-threaded approach for this app.
The options I have so far found seem to be:
- Free and open-source
- Requires an understanding of Docker and Shell
Async Programming via the Promises package
- Offloads more time intensive tasks away from main R thread so that R can remain responsive to simpler tasks
- Requires additional R coding that is not clear to me whether it can support parallelised functions that return large lists.
Switch Hosting to Shiny Server Pro or RStudioConnect
- Simple deployment with no real code changes necessary
- Expensive (>$10k per year)
Have the same version of the app hosted on multiple domains. Assign each user to their own domain.
- Doesn't add any costs to existing hosting service
- Requires managing and deploying the app across multiple domains
- Perhaps some efficiency loss and duplication in resource allocation by hosting the same app across multiple domains.
Use a load balancer within a single domain to assign users their own separate port
- Requires a sql server and perhaps a complicated implementation
These are all the solutions I found, and to be honest I don't understand all of them. Is there anything that should be added or changed to this list?