<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/effectively-scaling-shiny-in-enterprise/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://www.mango-solutions.com/blog/effectively-scaling-shiny-in-the-enterprise"> Mango Solutions</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p> <img alt="" sizes="100vw" src="https://i0.wp.com/www.mango-solutions.com/blog/images/f/3/b/1/7/f3b17e31f289aa5b60e30508637a3b7e8754e1fd-title.png?w=456&ssl=1" data-recalc-dims="1"></p>
<h5><em> James Blair, RStudio</em></h5>
<p>Scalability is a hot word these days, and for good reason. As data continues to grow in volume and importance, the ability to reliably access and reason about that data increases in importance. Enterprises expect data analysis and reporting solutions that are robust and allow several hundred, even thousands, of concurrent users while offering up-to-date security options.</p>
<p><a rel="nofollow" href="http://shiny.rstudio.com/" target="_blank">Shiny</a> is a highly flexible and widely used framework for creating web applications using R. It enables data scientists and analysts to create dynamic content that provides straightforward access to their work for those with no working knowledge of R. While Shiny has been around for quite some time, recent introductions to the Shiny ecosystem make Shiny simpler and safer to deploy in an enterprise environment where security and scalability are paramount. These new tools in connection with <a rel="nofollow" href="https://www.rstudio.com/products/connect/" target="_blank">RStudio Connect</a> provide enterprise grade solutions that make Shiny an even more attractive option for data resource creation.</p>
<h3>Develop and Test</h3>
<p>Most Shiny applications are developed either locally on a personal computer or using an instance of <a rel="nofollow" href="https://www.rstudio.com/products/rstudio/#Server" target="_blank">RStudio Server</a>. During development it can be helpful to understand application performance, specifically if there are any concerning bottlenecks. The <a rel="nofollow" href="https://rstudio.github.io/profvis/examples.html#example-3---profiling-a-shiny-application" target="_blank"><code>profvis</code></a> package provides functions for profiling R code and can profile the performance of Shiny applications. <code>profvis</code> provides a breakdown of code performance and can be useful for identifying potential areas for improving application responsiveness.</p>
<p>The recently released <a rel="nofollow" href="https://rstudio.github.io/promises/index.html" target="_blank"><code>promises</code></a> package provides <a rel="nofollow" href="https://rstudio.github.io/promises/articles/shiny.html" target="_blank">asynchronous capabilities to Shiny applications</a>. Asynchronous programming can be used to improve application responsiveness when several concurrent users are accessing the same application. While there is some overhead involved in creating asynchronous applications, this method can improve application responsiveness.</p>
<p>Once an application is fully developed and ready to be deployed, it’s useful to establish a set of behavioral expectations. These expectations can be used to ensure that future updates to the application don’t break or unexpectedly change behavior. Traditionally most testing of Shiny applications has been done by hand, which is both time consuming and error prone. The new <a rel="nofollow" href="https://rstudio.github.io/shinytest/articles/shinytest.html" target="_blank"><code>shinytest</code></a> package provides a clean interface for testing Shiny applications. Once an application is fully developed, a set of tests can be recorded and stored to compare against future application versions. These tests can be run programatically and can even be <a rel="nofollow" href="https://rstudio.github.io/shinytest/articles/ci.html" target="_blank">used with continuous integration (CI) platforms</a>. Robust testing for Shiny applications is a huge step forward in increasing the deployability and dependability of such applications.</p>
<h3>Deploy</h3>
<p>Once an application has been developed and tested to satisfaction, it must be deployed to a production environment in order to provide other users with application access. Production deployment of data resources within an enterprise centers on control. For example, access control and user authentication are important for controlling who has access to the application. Server resource control and monitoring are important for controlling application performance and server stability. These control points enable trustworthy and performant deployment.</p>
<p>There are a few current solutions for deploying Shiny applications. <a rel="nofollow" href="https://www.rstudio.com/products/shiny/shiny-server/" target="_blank">Shiny Server</a> provides both an open source and professional framework for publishing Shiny applications and making them available to a wide audience. The professional version provides features that are attractive for enterprise deployment, such as user authentication. <a rel="nofollow" href="https://www.rstudio.com/products/connect/" target="_blank">RStudio Connect</a> is a recent product from RStudio that provides several enhancements to Shiny Server. Specifically, RStudio Connect supports push button deployment and natively handles application dependencies, both of which simplify the deployment process. RStudio Connect also places resource control in the hands of the application developer, which lightens the load on system administrators and allows the developer to tune app performance to align with expectations and company priorities.</p>
<h3>Scale</h3>
<p>In order to be properly leveraged, a deployed application must scale to meet user demand. In some instances, applications will have low concurrent users and will not need any additional help to remain responsive. However, it is often the case in large enterprises that applications are widely distributed and concurrently accessed by several hundred or even thousands of users. RStudio Connect provides the ability to set up a cluster of servers to provide high availability (HA) and load balanced configurations in order to scale applications to meet the needs of concurrent users. Shiny itself has been <a rel="nofollow" href="https://www.rstudio.com/resources/videos/scaling-shiny/" target="_blank">shown to effectively scale</a> to meet the demands of 10,000 concurrent users!</p>
<p>As businesses continue searching for ways to efficiently capture and digest growing stores of data, R in connection with Shiny continues to establish itself as a robust and enterprise ready solution for data analysis and reporting.</p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://www.mango-solutions.com/blog/effectively-scaling-shiny-in-the-enterprise"> Mango Solutions</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/rHxdYQNhj68" height="1"></a></div>