Best practices for building Shiny enterprise applications use
Best practices for building Shiny enterprise applications/ use. R! 2019 Toulouse Filip Stachura @filipstachura
OUR SERVICES ● Data Science consulting 40 Projects delivered ● Business applications of Machine Learning ● Satellite data analysis ● R & Python programming ● World class R-Shiny production solutions 50 700 Commercial Shiny dashboards delivered Max no. of concurrent users using our Shiny dashboard @filipstachura
OUR WORK @filipstachura
SELECTED CLIENTS @filipstachura
Why ? @filipstachura
WHY SHINY Django, React, Angular, Go, Scala. . . Excel. Business Intelligence. Tableau, Power. Bi, Qlik Fast prototyping. One language. Clean structure. Scalability. Correctness. No limitations. Full power. @filipstachura
6 LESSONS FOR ENTERPRISE SHINY 1 2 3 Start with prototype. Build for maintainability and dev velocity. Create a test pyramid. 4 5 6 Avoid errors, learn from mistakes. Scale and perform. Automate fully. @filipstachura
START WITH PROTOTYPE Customer Development Buy-in from users Productionization @filipstach
MAINTAINABILITYAND VELOCITY Traits of a good architecture: 1. Use of modules. 2. Logic extracted and tested. 3. No heavy computations*. 4. Data loaded from database. * but avoid premature optimization! @filipstachura
SHINY TEST PYRAMID Source: https: //watirmelon. blog/testing-pyramids/ Ideal Software Testing Pyramid @filipstachura
SHINY TEST CONE Source: https: //watirmelon. blog/testing-pyramids/ Software Testing Ice-cream Cone Anti-Pattern @filipstachura
AVOID ERRORS IN PRODUCTION 1. Always validate data. 2. Dataset owner alerts. 3. Logging infrastructure. 4. Fault tolerance. @filipstachura
AVOID ERRORS IN PRODUCTION Daily data validation email Continuous integration Style improvement Show data status in app @filipstachura
DATA VALIDATION LEVELS Data quality is more than structure and format Read more: appsilon. com/data-quality/ @filipstachura
SCALING AND PERFORMANCE 1. Load balance: a. RStudio Connect b. Amazon ELB 2. Profile. 3. Run performance tests. a. headless b. non-headless @filipstachura
EXAMPLE ARCHITECTURE QUERY SERVER 1 QS 2 MASTER NODE (RESULTS PROCESSING+VIS) QS 3 QSn APP 2 GOOGLE PUPPETEER AWS APPLICATION LOAD BALANCER APP 1 ANSIBLE R APPn DB @filipstachura
DEPLOYMENT STRATEGIES 1 deployment environment. Manual. Not optimized. 2 -3 environments: staging, test, production. Automated (e. g. ansible, docker) saves time, easy roll back, one click to drop or create server Avoid static files. Bundle what you can. @filipstachura
DECISION SUPPORT SYSTEM: WHAT’S BELOW THE SURFACE? UI & FEATURES AUTOMATED TESTS DATA VALIDATION IN ETL LOAD & PERFORMANCE TESTS SSO INTEGRATION AUTOMATED DEPLOYMENT END-TO-END TESTS AUTOMATED CODE QUALITY CHECKS @filipstachura
Shiny is ready for production! Let’s grab a coffee! �� filip@appsilon. com
- Slides: 19