By: Peter Solymos
You mastered Shiny, your app is production-ready. Here are the different ways of hosting it. This post helps you pick one that best suits your needs!
The Hosting Data Apps website recently celebrated its 6-months anniversary. During this time I have written 40 posts, almost all about Shiny hosting options. Some of these posts reviewed particular hosting options, such as Shinyapps.io, Shiny Server, Heroku, and ShinyProxy.
A lot has been said about the hosting options themselves, but what about the needs of the developers and the users? The goal of this post is to address this shortcoming by summarizing the reviews.
You might have seen various websites listing comparisons titled "A vs. B". I was wondering if doing something like that would make sense for the Hosting Data site. Think like "Which is better: Shinyapps or Heroku?".
This would instantly give me 36 more articles to write. Plenty of ammunition for the next 9 months by recycling the previous content. Easy-peasy, if all I wanted was to boost the page ranking.
Instead, I decided that these A vs. B posts are useless. They fail to ask the most important question: "which option is better **for what"? This is where developers and the users of the app come into the picture with their **specific needs and constraints.
You could say, for example, that "I want to host my portfolio for free and I don't care about a custom domain name". Or a nonprofit might say, "we want to host our apps at low cost, we want custom domains, and we want to be able to handle surge traffic, but we don't want to maintain any servers".
These are really specific criteria, and if you ask me, I might say Shinyapps.io is best for you and Heroku with a Docker-based deployment is best for this organization. But how would you or I make such a decision?
If you have been developing Shiny apps, you might already have your preferred way of deployment. But as your needs evolve, you will identify additional requirements and might find that your go-to option is not the best anymore. Then you'll do some research and find the next option.
If you are not yet familiar with Shiny hosting options, you still need to make an informed choice at some point, so that you are not wasting your time and effort on something that will not serve you well over the long run. Here is the 3 step process that you can follow to help you with this decision.
Before you begin take a piece of paper.
Why do you want the app or apps deployed? Are you building a portfolio to boost your career? Are you deploying useful apps for stakeholders or clients of your organization? Are you trying to sell an app as a software-as-a-service (SaaS) offering?
Write down your answer.
Getting clear on the why is the most important question. You might even realize that you don't need to host your Shiny app. For example, your app might be used on a laptop as a GUI to analyze data by non-specialists in the field without internet or cell coverage. In this case, no need to move on to step 2, because all you need is to run Shiny locally.
However, if your answer makes it clear to you that your users will be accessing the app over the Internet, move on to step 2.
Answering the Why question will probably reveal important details about your motivations, your audience, the number of apps you are going to host, etc. The answer will also bring you closer to identifying the requirements that you'll need.
For example, do you need a custom domain, how many users are you expecting, do you need authentication or app-level authorization? Do you want to host a single app or do you need to host many apps? Will you host non-Shiny apps?
Write these down too.
The following table lists the important features for many different Shiny hosting options. The table lists tiers offered by the same company as a separate option. Use this table to find the options that meet your requirements. For now, just ignore the columns inside the blue rectangle.
If you crave a more interactive experience, I made a filterable version:
Here is the link to the page where you can filter the options.
Once you filter the table according to your requirements, you'll see a list of your ideal hosting options. Put these in the file or onto the paper too.
The last step involves identifying your constraints:
- What is your budget?
- What is your current skill level?
- How much time do you have time?
Recognizing these constraints will guide you toward an optimal solution. This is the point where the columns inside the blue rectangle come in.
The "Total Cost" of ownership (USD/year) covers licensing fees and operating costs for the "Number of Apps" listed in the table. Prices range quite a bit from free to the tens of thousands. Price increases with performance and with the availability of enterprise features, such as custom domains and authentication.
PaaS means platform-as-a-service, i.e. it is a fully managed system without you having to worry about the underlying infrastructure. This also means less control over the infrastructure, i.e. when it comes to choosing the data region where your app is served from.
Unlimited app hours are more common for self-hosted options or paid PaaS plans including a single app. The need to host multiple apps will involve some compromises. The ability to host non-Shiny apps (Dahs, Streamlit, etc.) is a feature for RStudio Connect and the Docker-based options.
Time as a constraint will depend on how far your current skill level is from the level needed for a specific hosting option. You also have to consider that some options are fully managed PaaS offerings, others you have to manage, or learn how to use Docker.
If you have to develop new skills, it might take longer. If you have to manage your servers, it will take more time to get started and then you are on the hook for maintaining your setup.
Make your selections inside the columns within the blue area.
After the 3-step process, you should see only a few or a single option left. Click on the name of the hosting option and the link will take you to the relevant tag page on the Hosting Data Apps website:
- Follow the instructions in the tutorials to get started
- At the end of each post, you'll find a Further reading section listing additional resources
If there is no option left in the table, then you might need to be more realistic about your expectations or relax some of your constraints. For example, to keep costs low, you could spend more time and invest in skill development. But if you have more room in your budget, you might choose a different path. You can also revise your requirements until you find an acceptable solution.
The following diagram gives an intuitive overview of the different options. The vertical axis represents the total cost from the table above: free, low, and high cost. The horizontal axis shows a range of skills you need to set up and manage your hosting solution. It can be as simple as pushing a button, or as complex as managing servers or cloud clusters.
The hosting options in this diagram are not separated by tiers but rather shown as spanning over a range. The fill colours identify Docker and non-Docker-based options, the stroke styling indicates the PaaS solutions.
If you followed the 3-step process to collect all the information you need, it is likely that you have found an option that is best for your needs. Now go ahead and learn more about that option, deploy, and start hosting your app.
Shiny is a very popular interactive data application framework. As a result, new hosting options are popping up every time. As the number of these hosting options grows in the future, I might update this post by adding the new contenders to the table.