Grow your data science skills at posit::conf(2024)

August 12th-14th in Seattle

How Posit streamlined our deployment process and unified our teams

Written by Erika Braithwaite, CEO, and Kathryn Morrison, CTO, at Precision Analytics
Person looking at data on a tablet

The Problem

In our early days as a biostatistical consultancy, we were often approached by early-stage drug development or biotechnology companies for assistance with study design, statistical analyses, and bioinformatics. Our clients generally did not have in-house capacity for analytics, and waiting for bespoke outsourced results for each experiment was a huge expense and bottleneck in their research. We saw and solved the same problems repeatedly: integrating disparate sources of data, building pipelines and databases, implementing analytics, and producing regular reports of results.

R was an obvious tool of choice since much of our team is made up of data scientists who have known and loved R for years. It was a revelation when we first began using Shiny, and saw the powerful capabilities R had for web development. Our software developers were quick to pick up R and see that the language can actually be used for web development in addition to analytics. Having a common language within our company has facilitated a lot of learning and growth.

“The greatest and most immediate advantage we experienced after switching to Posit Connect was the ease with which our applications could be deployed.”

Erika Braithwaite and Kathryn Morrison
Precision Analytics

The Solution

We decided to thoughtfully automate parts of our service offering, while still tailoring the analytics to the client’s needs, and to subsequently create customized, secure dashboards for interactively visualizing and communicating the results. This way, our clients could log into their personalized dashboard and view the latest results immediately, instead of waiting for third party analysis firms to analyze each experiment and supply spreadsheets and reports by email. Given our team’s strength in R, we naturally began searching for a package that could facilitate this process, and discovered that Shiny offered a great deal of the functionality we required in an extensible, developer-friendly framework.

Combined with the DThtmlwidgets, and shinythemes packages, Shiny provides a vast selection of tools that make starting a new client application a breeze, but the perks don’t stop there. Shiny was created with extensibility and customization in mind, providing experienced developers the ability to extend existing widgets, as well as create entirely new ones, through an intuitive, robust interface. Thanks to these features, Shiny made it possible for us to meet all of our clients’ needs and deliver truly personalized applications for exploring and visualizing their data.

As our clients’ requests became more complex, so did the Shiny applications powering them. Thankfully, we were able to manage this growing complexity by leveraging Shiny modules, which enabled us to maintain a clean architecture as an ever-increasing number of features and functionality were added.

Why Posit Professional Products?

While development of our client applications with Shiny was immediately successful, we found some of the technical challenges we were facing during deployment were time-consuming and added unnecessary overhead. For instance, given that our applications were being deployed with the Open Source Shiny Server, we had no means of authenticating individual users. While we managed to implement user authentication using Amazon Web Services Application Load Balancers and Amazon Cognito, managing an authenticated user’s session using the information provided by these services was not trivial; not only did it require communicating with a third-party API, but it even required us to create additional middleware for providing some of the missing user meta-data to Shiny.

As the number of clients, and the number of users required for each, grew, we began exploring Posit Connect to help simplify the deployment process of our client applications. It was then that we discovered Posit Connect, which presented a very appealing alternative. After comparing the various features of these two solutions, our decision to move to Posit Connect was primarily influenced by a few noteworthy features: push-button and git-backed deployments, simple user management, and the ability to deploy different types of content in addition to Shiny applications.

The Payoff

The greatest and most immediate advantage we experienced after switching to Posit Connect was the ease with which our applications could be deployed. Pushing changes to a live server no longer consisted of a sole developer scrambling to synchronize a myriad of dependencies in time for a deadline. Instead, any member of the team can deploy an application they are working on with just the push of a button, or by simply pushing their changes to the remote repository. Most importantly, if a breaking change is ever accidentally introduced in an application that has been deployed, Posit Connect enables us to roll back to a previously deployed version with the click of a button, ensuring our clients experience as little downtime as possible while we explore the logs to find the source of the error.

Once an application is deployed, controlling which users can access it is no longer the responsibility of the application, as Posit Connect provides a simple user interface that enables limiting access to a specific set of users. In addition, once an authenticated user accesses the application, we no longer need to communicate with middleware and third-party APIs to retrieve their meta-data; Posit Connect conveniently puts the data we need right into Shiny’s session object. To top it all off, users no longer need to contact our developers for support when they forget their passwords, since Posit Connect enables them to request a password reset via email should this occur.
Even more exciting than the invaluable improvements we have experienced in deploying our Shiny applications are the possibilities that Posit Connect empowers. While our clients greatly appreciate being able to interactively explore and visualize their data, there is still the occasional need for brief, static summary reports. With Posit Connect, such reports can not only be deployed, but also scheduled and automatically sent to our clients on a regular basis. In addition, the ability to deploy plumber APIs enables us to extract common functionality into independent services that can be leveraged by several applications, reducing the amount of work that is duplicated across projects. We look forward to exploring and experimenting with all that Posit Connect makes possible as we move forward.

About Precision Analytics

Precision Analytics is a health data science company with both product and service offerings. We work with clients across the drug development spectrum, from early-stage bench science to clinical trials to post-market drug surveillance. By blending scalable data infrastructures, high level statistical expertise, and thoughtful automation, our Precisely Bio platform built using Posit Connect offers “cradle to grave” support for bioinformatics.

Subscribe to more inspiring open-source data science content.

We love to celebrate and help people do great science. By subscribing, you'll get alerted whenever we publish something new.