SlideShare a Scribd company logo
1 of 23
Data for all
Empowering teams with scalable Shiny applications
Data culture
• In many organisations, data scientists find themselves responsible for
introducing a data culture in an environment where data was not
used historically
• One strategy for doing so involves making data accessible to teams
across the organisation in a way that is easy to understand and use
• Internal dashboards are a great way of exposing data to teams at the
right level – not too raw, but not so summarised as to be unactionable
• Our tool of choice for building internal dashboards is Shiny
No-ETL
• No ETL required – queries run directly against the analytics database
• Pro: data scientists work independently of engineers as they can
simply code any extra complexity (e.g. cohorting) into the dashboard
directly
• Con: there's potential for long-running queries that would lock up the
dashboard for other users
Shiny tech challenges
• How do we:
• Allow for potentially long-running reactive() expressions
• Support 10s or 100s of concurrent users
• Package all this up for cloud deployment via a DevOps pipeline
• Integrate with an existing user account system (e.g. Exchange)
Asynchronicity and concurrency
How we use futures and promises to support long-running queries and many
concurrent users
Promises
• R is traditionally single-threaded
• This restriction is inherited by Shiny
• Whilst we wait for a DB query to return, our dashboard stalls for other users
• Enter promises and futures!
• Promises represent a value that will be ready later
• We can do other work whilst waiting
• In a dashboard context, we use promises to represent DB queries that
retrieve a data frame, and are started with the "Apply filters" button
Futures
• Promises alone don’t fix our problem
• They represent the “promise” of an eventual value but don’t give us any way
to actually do work elsewhere to retrieve it
• Futures are a concrete method of fulfilling promises by executing
code in a separate R interpreter instance
• They meet the spec for promises, so we can use them like so:
• future({ slow_db_query() }) %...>% print()
Futures and promises in Shiny
• Support has been rolling out into the ecosystem over the last few
years
• Fully supported by reactive expressions and render functions
Packaging with Docker and
Packrat
How do we take our source code plus dependencies and package it all up into a
single standalone container?
Packrat
• Solves the problem of managing package dependencies
for an R project
• Maintains a manifest file, packrat.lock, describing
exactly which versions of what packages your project
needs
• Saves your colleagues from the inevitable hell of
coordinating package upgrades
• Just updated to latest from your dashboard repo?
• Simply run packrat::restore()
Docker
• Allows us to package an application up with all of its
system-level dependencies, even the OS
• You write a Dockerfile, which describes how to build the
service
• These containers can then be downloaded and run via
several different methods:
• Standalone, with docker run $your_container_name
• On an orchestration platform, like Kubernetes or ECS
• More on this later!
Docker – pseudo-Dockerfile steps
• Use Ubuntu 18 as a base
• Install R and packrat
• Copy our packrat.lock into the container, and run packrat::install()
• Copy the rest of our dashboard source code
• Record that we’re exposing port 3838 for incoming connections
Deploying to the cloud
With our dashboard packaged up, how do we get it deployed somewhere? What
other services can we make use of to solve some of our problems?
Amazon Web Services
• Most popular cloud provider
• Basic services like Elastic Compute Cloud (EC2), for manually
provisioning VMs
• Sometimes useful, but we want a little less work to do
• Value-add services like Elastic Container Service (ECS)
Elastic Container Service (ECS)
• Allows us to orchestrate the deployment of applications we’ve
bundled up into Docker containers
• First, we push our dashboard container image to Amazon’s private
container registry
• Then we can represent each dashboard as a service in ECS
• Upgrades are simple: just update the service definition with the latest
container ID, and ECS will roll out the change for you
Scaling on ECS
• A single service is fine, but do we handle situations where we have
more users than one instance can handle?
• A service can have a configurable number of tasks
• For static use cases, you can just set a number of tasks to run
• For complex or variable situations, you can auto-scale your task count
based on metrics like current CPU usage
• This gives us additional ability to handle traffic beyond even what the
aforementioned futures and promises give us
Network infrastructure
• Services can integrate with an Application Load Balancer (ALB) that's
tied to a domain, like some-dashboard.my-company.com
• Now, users can simply navigate to that address and browse the
dashboard!
• To lock this down to just our authenticated users, we utilise another
service called Cognito that integrates with our user account database
and handles the sign-in process for us
Application
Load Balancer
Cognito
Dashboard service in ECS
Dashboard task
1
Dashboard task
2
Dashboard task
N...
Users
User loads https://dashboard.my-company.com in a browser
ALB passes the request to Cognito
If the user is already authenticated, forward the request to Shiny!
Otherwise, prompt the user to sign in
Account
DB
Data
Warehouse
The data science workflow
Dashboard workflow goals
• No data engineers required for day-to-day work
• Minimal latency when publishing new analyses and views
• Code review in GitHub for all non-trivial changes
Continuous deployment
• Just responsible for building and pushing our Docker images
• Tooling: TeamCity, Jenkins, CodePipeline, etc
• Any commits merged into the master branch automatically trigger a
build and redeploy
• New content is made available to users in a matter of minutes
HypotheSci
• Consultancy for data science and engineering
• End-to-end data and dashboard pipelines that empower teams and
help organisations leverage their data
Feel free to reach out :)
Ruan Pearce-Authers
Twitter: @returnString
Email: ruan@hypothesci.com
Alexandra Țurcan
Twitter: @AleTurcan
Email: alex@hypothesci.com

More Related Content

What's hot

Set your Data in Motion with Confluent & Apache Kafka Tech Talk Series LME
Set your Data in Motion with Confluent & Apache Kafka Tech Talk Series LMESet your Data in Motion with Confluent & Apache Kafka Tech Talk Series LME
Set your Data in Motion with Confluent & Apache Kafka Tech Talk Series LMEconfluent
 
Microservices for a Streaming World
Microservices for a Streaming WorldMicroservices for a Streaming World
Microservices for a Streaming WorldBen Stopford
 
Fundamentals and Architecture of Apache Kafka
Fundamentals and Architecture of Apache KafkaFundamentals and Architecture of Apache Kafka
Fundamentals and Architecture of Apache KafkaAngelo Cesaro
 
Building High-Throughput, Low-Latency Pipelines in Kafka
Building High-Throughput, Low-Latency Pipelines in KafkaBuilding High-Throughput, Low-Latency Pipelines in Kafka
Building High-Throughput, Low-Latency Pipelines in Kafkaconfluent
 
Oracle WebLogic 12c New Multitenancy features
Oracle WebLogic 12c New Multitenancy featuresOracle WebLogic 12c New Multitenancy features
Oracle WebLogic 12c New Multitenancy featuresMichel Schildmeijer
 
Stream-Native Processing with Pulsar Functions
Stream-Native Processing with Pulsar FunctionsStream-Native Processing with Pulsar Functions
Stream-Native Processing with Pulsar FunctionsStreamlio
 
Scala Security: Eliminate 200+ Code-Level Threats With Fortify SCA For Scala
Scala Security: Eliminate 200+ Code-Level Threats With Fortify SCA For ScalaScala Security: Eliminate 200+ Code-Level Threats With Fortify SCA For Scala
Scala Security: Eliminate 200+ Code-Level Threats With Fortify SCA For ScalaLightbend
 
Keeping up with Tech
Keeping up with Tech Keeping up with Tech
Keeping up with Tech Elana Krasner
 
Scalable Spark deployment using Kubernetes
Scalable Spark deployment using KubernetesScalable Spark deployment using Kubernetes
Scalable Spark deployment using Kubernetesdatamantra
 
Introduction to Kafka
Introduction to KafkaIntroduction to Kafka
Introduction to KafkaDucas Francis
 
Advanced dev ops governance with terraform
Advanced dev ops governance with terraformAdvanced dev ops governance with terraform
Advanced dev ops governance with terraformJames Counts
 
How Apache Kafka® Works
How Apache Kafka® WorksHow Apache Kafka® Works
How Apache Kafka® Worksconfluent
 
REST vs. Messaging For Microservices
REST vs. Messaging For MicroservicesREST vs. Messaging For Microservices
REST vs. Messaging For MicroservicesEberhard Wolff
 
Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)
Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)
Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)Lucas Jellema
 
Building an Event-oriented Data Platform with Kafka, Eric Sammer
Building an Event-oriented Data Platform with Kafka, Eric Sammer Building an Event-oriented Data Platform with Kafka, Eric Sammer
Building an Event-oriented Data Platform with Kafka, Eric Sammer confluent
 
Introducing Kubernetes
Introducing Kubernetes Introducing Kubernetes
Introducing Kubernetes VikRam S
 
The Architect's Two Hats
The Architect's Two HatsThe Architect's Two Hats
The Architect's Two HatsBen Stopford
 
Lessons learned migrating 100+ services to Kubernetes
Lessons learned migrating 100+ services to KubernetesLessons learned migrating 100+ services to Kubernetes
Lessons learned migrating 100+ services to KubernetesJose Galarza
 

What's hot (20)

Set your Data in Motion with Confluent & Apache Kafka Tech Talk Series LME
Set your Data in Motion with Confluent & Apache Kafka Tech Talk Series LMESet your Data in Motion with Confluent & Apache Kafka Tech Talk Series LME
Set your Data in Motion with Confluent & Apache Kafka Tech Talk Series LME
 
Microservices for a Streaming World
Microservices for a Streaming WorldMicroservices for a Streaming World
Microservices for a Streaming World
 
Fundamentals and Architecture of Apache Kafka
Fundamentals and Architecture of Apache KafkaFundamentals and Architecture of Apache Kafka
Fundamentals and Architecture of Apache Kafka
 
Building High-Throughput, Low-Latency Pipelines in Kafka
Building High-Throughput, Low-Latency Pipelines in KafkaBuilding High-Throughput, Low-Latency Pipelines in Kafka
Building High-Throughput, Low-Latency Pipelines in Kafka
 
Javascript Today
Javascript TodayJavascript Today
Javascript Today
 
Oracle WebLogic 12c New Multitenancy features
Oracle WebLogic 12c New Multitenancy featuresOracle WebLogic 12c New Multitenancy features
Oracle WebLogic 12c New Multitenancy features
 
Stream-Native Processing with Pulsar Functions
Stream-Native Processing with Pulsar FunctionsStream-Native Processing with Pulsar Functions
Stream-Native Processing with Pulsar Functions
 
Jelastic Turnkey Cloud PaaS for Developers
Jelastic Turnkey Cloud PaaS for DevelopersJelastic Turnkey Cloud PaaS for Developers
Jelastic Turnkey Cloud PaaS for Developers
 
Scala Security: Eliminate 200+ Code-Level Threats With Fortify SCA For Scala
Scala Security: Eliminate 200+ Code-Level Threats With Fortify SCA For ScalaScala Security: Eliminate 200+ Code-Level Threats With Fortify SCA For Scala
Scala Security: Eliminate 200+ Code-Level Threats With Fortify SCA For Scala
 
Keeping up with Tech
Keeping up with Tech Keeping up with Tech
Keeping up with Tech
 
Scalable Spark deployment using Kubernetes
Scalable Spark deployment using KubernetesScalable Spark deployment using Kubernetes
Scalable Spark deployment using Kubernetes
 
Introduction to Kafka
Introduction to KafkaIntroduction to Kafka
Introduction to Kafka
 
Advanced dev ops governance with terraform
Advanced dev ops governance with terraformAdvanced dev ops governance with terraform
Advanced dev ops governance with terraform
 
How Apache Kafka® Works
How Apache Kafka® WorksHow Apache Kafka® Works
How Apache Kafka® Works
 
REST vs. Messaging For Microservices
REST vs. Messaging For MicroservicesREST vs. Messaging For Microservices
REST vs. Messaging For Microservices
 
Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)
Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)
Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)
 
Building an Event-oriented Data Platform with Kafka, Eric Sammer
Building an Event-oriented Data Platform with Kafka, Eric Sammer Building an Event-oriented Data Platform with Kafka, Eric Sammer
Building an Event-oriented Data Platform with Kafka, Eric Sammer
 
Introducing Kubernetes
Introducing Kubernetes Introducing Kubernetes
Introducing Kubernetes
 
The Architect's Two Hats
The Architect's Two HatsThe Architect's Two Hats
The Architect's Two Hats
 
Lessons learned migrating 100+ services to Kubernetes
Lessons learned migrating 100+ services to KubernetesLessons learned migrating 100+ services to Kubernetes
Lessons learned migrating 100+ services to Kubernetes
 

Similar to Data for all: Empowering teams with scalable Shiny applications @ useR 2019

Docker for the enterprise
Docker for the enterpriseDocker for the enterprise
Docker for the enterpriseBert Poller
 
Containers, microservices and serverless for realists
Containers, microservices and serverless for realistsContainers, microservices and serverless for realists
Containers, microservices and serverless for realistsKarthik Gaekwad
 
Seminar Modernizing Your Development Using Microservices, Container & Kubernetes
Seminar Modernizing Your Development Using Microservices, Container & KubernetesSeminar Modernizing Your Development Using Microservices, Container & Kubernetes
Seminar Modernizing Your Development Using Microservices, Container & KubernetesPT Datacomm Diangraha
 
Cloud technology with practical knowledge
Cloud technology with practical knowledgeCloud technology with practical knowledge
Cloud technology with practical knowledgeAnshikaNigam8
 
GCCP JSCOE Session 2
GCCP JSCOE Session 2GCCP JSCOE Session 2
GCCP JSCOE Session 2GDSC
 
Bringing AI to the edge on-premises Azure Cognitive Services using Docker con...
Bringing AI to the edge on-premises Azure Cognitive Services using Docker con...Bringing AI to the edge on-premises Azure Cognitive Services using Docker con...
Bringing AI to the edge on-premises Azure Cognitive Services using Docker con...Luis Beltran
 
Why kubernetes matters
Why kubernetes mattersWhy kubernetes matters
Why kubernetes mattersPlatform9
 
Open shift and docker - october,2014
Open shift and docker - october,2014Open shift and docker - october,2014
Open shift and docker - october,2014Hojoong Kim
 
Architectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyArchitectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyComsysto Reply GmbH
 
Architectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyArchitectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyComsysto Reply GmbH
 
DockerPenang Meetup#1
DockerPenang Meetup#1DockerPenang Meetup#1
DockerPenang Meetup#1Sujay Pillai
 
The challenge of application distribution - Introduction to Docker (2014 dec ...
The challenge of application distribution - Introduction to Docker (2014 dec ...The challenge of application distribution - Introduction to Docker (2014 dec ...
The challenge of application distribution - Introduction to Docker (2014 dec ...Sébastien Portebois
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2Docker, Inc.
 
Structured Container Delivery by Oscar Renalias, Accenture
Structured Container Delivery by Oscar Renalias, AccentureStructured Container Delivery by Oscar Renalias, Accenture
Structured Container Delivery by Oscar Renalias, AccentureDocker, Inc.
 
Docker Application to Scientific Computing
Docker Application to Scientific ComputingDocker Application to Scientific Computing
Docker Application to Scientific ComputingPeter Bryzgalov
 
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)TIMETOACT GROUP
 

Similar to Data for all: Empowering teams with scalable Shiny applications @ useR 2019 (20)

Docker for the enterprise
Docker for the enterpriseDocker for the enterprise
Docker for the enterprise
 
Containers, microservices and serverless for realists
Containers, microservices and serverless for realistsContainers, microservices and serverless for realists
Containers, microservices and serverless for realists
 
Seminar Modernizing Your Development Using Microservices, Container & Kubernetes
Seminar Modernizing Your Development Using Microservices, Container & KubernetesSeminar Modernizing Your Development Using Microservices, Container & Kubernetes
Seminar Modernizing Your Development Using Microservices, Container & Kubernetes
 
Cloud technology with practical knowledge
Cloud technology with practical knowledgeCloud technology with practical knowledge
Cloud technology with practical knowledge
 
Containers and Docker
Containers and DockerContainers and Docker
Containers and Docker
 
GCCP JSCOE Session 2
GCCP JSCOE Session 2GCCP JSCOE Session 2
GCCP JSCOE Session 2
 
Mcroservices with docker kubernetes, goang and grpc, overview
Mcroservices with docker kubernetes, goang and grpc, overviewMcroservices with docker kubernetes, goang and grpc, overview
Mcroservices with docker kubernetes, goang and grpc, overview
 
Bringing AI to the edge on-premises Azure Cognitive Services using Docker con...
Bringing AI to the edge on-premises Azure Cognitive Services using Docker con...Bringing AI to the edge on-premises Azure Cognitive Services using Docker con...
Bringing AI to the edge on-premises Azure Cognitive Services using Docker con...
 
Why kubernetes matters
Why kubernetes mattersWhy kubernetes matters
Why kubernetes matters
 
Open shift and docker - october,2014
Open shift and docker - october,2014Open shift and docker - october,2014
Open shift and docker - october,2014
 
Architectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyArchitectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and Consistently
 
Architectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyArchitectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and Consistently
 
DockerPenang Meetup#1
DockerPenang Meetup#1DockerPenang Meetup#1
DockerPenang Meetup#1
 
The challenge of application distribution - Introduction to Docker (2014 dec ...
The challenge of application distribution - Introduction to Docker (2014 dec ...The challenge of application distribution - Introduction to Docker (2014 dec ...
The challenge of application distribution - Introduction to Docker (2014 dec ...
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2
 
Structured Container Delivery by Oscar Renalias, Accenture
Structured Container Delivery by Oscar Renalias, AccentureStructured Container Delivery by Oscar Renalias, Accenture
Structured Container Delivery by Oscar Renalias, Accenture
 
Docker Application to Scientific Computing
Docker Application to Scientific ComputingDocker Application to Scientific Computing
Docker Application to Scientific Computing
 
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
 
Webinar : Docker in Production
Webinar : Docker in ProductionWebinar : Docker in Production
Webinar : Docker in Production
 
56k.cloud training
56k.cloud training56k.cloud training
56k.cloud training
 

Recently uploaded

Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...Suhani Kapoor
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsappssapnasaifi408
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiSuhani Kapoor
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfLars Albertsson
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxEmmanuel Dauda
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Callshivangimorya083
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiSuhani Kapoor
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxfirstjob4
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxolyaivanovalion
 
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一ffjhghh
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSAishani27
 

Recently uploaded (20)

Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
 
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in  KishangarhDelhi 99530 vip 56974 Genuine Escort Service Call Girls in  Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptx
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptx
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICS
 
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
 

Data for all: Empowering teams with scalable Shiny applications @ useR 2019

  • 1. Data for all Empowering teams with scalable Shiny applications
  • 2. Data culture • In many organisations, data scientists find themselves responsible for introducing a data culture in an environment where data was not used historically • One strategy for doing so involves making data accessible to teams across the organisation in a way that is easy to understand and use • Internal dashboards are a great way of exposing data to teams at the right level – not too raw, but not so summarised as to be unactionable • Our tool of choice for building internal dashboards is Shiny
  • 3.
  • 4. No-ETL • No ETL required – queries run directly against the analytics database • Pro: data scientists work independently of engineers as they can simply code any extra complexity (e.g. cohorting) into the dashboard directly • Con: there's potential for long-running queries that would lock up the dashboard for other users
  • 5. Shiny tech challenges • How do we: • Allow for potentially long-running reactive() expressions • Support 10s or 100s of concurrent users • Package all this up for cloud deployment via a DevOps pipeline • Integrate with an existing user account system (e.g. Exchange)
  • 6. Asynchronicity and concurrency How we use futures and promises to support long-running queries and many concurrent users
  • 7. Promises • R is traditionally single-threaded • This restriction is inherited by Shiny • Whilst we wait for a DB query to return, our dashboard stalls for other users • Enter promises and futures! • Promises represent a value that will be ready later • We can do other work whilst waiting • In a dashboard context, we use promises to represent DB queries that retrieve a data frame, and are started with the "Apply filters" button
  • 8. Futures • Promises alone don’t fix our problem • They represent the “promise” of an eventual value but don’t give us any way to actually do work elsewhere to retrieve it • Futures are a concrete method of fulfilling promises by executing code in a separate R interpreter instance • They meet the spec for promises, so we can use them like so: • future({ slow_db_query() }) %...>% print()
  • 9. Futures and promises in Shiny • Support has been rolling out into the ecosystem over the last few years • Fully supported by reactive expressions and render functions
  • 10. Packaging with Docker and Packrat How do we take our source code plus dependencies and package it all up into a single standalone container?
  • 11. Packrat • Solves the problem of managing package dependencies for an R project • Maintains a manifest file, packrat.lock, describing exactly which versions of what packages your project needs • Saves your colleagues from the inevitable hell of coordinating package upgrades • Just updated to latest from your dashboard repo? • Simply run packrat::restore()
  • 12. Docker • Allows us to package an application up with all of its system-level dependencies, even the OS • You write a Dockerfile, which describes how to build the service • These containers can then be downloaded and run via several different methods: • Standalone, with docker run $your_container_name • On an orchestration platform, like Kubernetes or ECS • More on this later!
  • 13. Docker – pseudo-Dockerfile steps • Use Ubuntu 18 as a base • Install R and packrat • Copy our packrat.lock into the container, and run packrat::install() • Copy the rest of our dashboard source code • Record that we’re exposing port 3838 for incoming connections
  • 14. Deploying to the cloud With our dashboard packaged up, how do we get it deployed somewhere? What other services can we make use of to solve some of our problems?
  • 15. Amazon Web Services • Most popular cloud provider • Basic services like Elastic Compute Cloud (EC2), for manually provisioning VMs • Sometimes useful, but we want a little less work to do • Value-add services like Elastic Container Service (ECS)
  • 16. Elastic Container Service (ECS) • Allows us to orchestrate the deployment of applications we’ve bundled up into Docker containers • First, we push our dashboard container image to Amazon’s private container registry • Then we can represent each dashboard as a service in ECS • Upgrades are simple: just update the service definition with the latest container ID, and ECS will roll out the change for you
  • 17. Scaling on ECS • A single service is fine, but do we handle situations where we have more users than one instance can handle? • A service can have a configurable number of tasks • For static use cases, you can just set a number of tasks to run • For complex or variable situations, you can auto-scale your task count based on metrics like current CPU usage • This gives us additional ability to handle traffic beyond even what the aforementioned futures and promises give us
  • 18. Network infrastructure • Services can integrate with an Application Load Balancer (ALB) that's tied to a domain, like some-dashboard.my-company.com • Now, users can simply navigate to that address and browse the dashboard! • To lock this down to just our authenticated users, we utilise another service called Cognito that integrates with our user account database and handles the sign-in process for us
  • 19. Application Load Balancer Cognito Dashboard service in ECS Dashboard task 1 Dashboard task 2 Dashboard task N... Users User loads https://dashboard.my-company.com in a browser ALB passes the request to Cognito If the user is already authenticated, forward the request to Shiny! Otherwise, prompt the user to sign in Account DB Data Warehouse
  • 20. The data science workflow
  • 21. Dashboard workflow goals • No data engineers required for day-to-day work • Minimal latency when publishing new analyses and views • Code review in GitHub for all non-trivial changes
  • 22. Continuous deployment • Just responsible for building and pushing our Docker images • Tooling: TeamCity, Jenkins, CodePipeline, etc • Any commits merged into the master branch automatically trigger a build and redeploy • New content is made available to users in a matter of minutes
  • 23. HypotheSci • Consultancy for data science and engineering • End-to-end data and dashboard pipelines that empower teams and help organisations leverage their data Feel free to reach out :) Ruan Pearce-Authers Twitter: @returnString Email: ruan@hypothesci.com Alexandra Țurcan Twitter: @AleTurcan Email: alex@hypothesci.com