SlideShare a Scribd company logo

Preparing for Growth - Architecting Giant Apps for Scalability and Build Speed

B
B

SwiftHeroes 2021 Bruno Rocha

Preparing for Growth - Architecting Giant Apps for Scalability and Build Speed

1 of 38
Download to read offline
Preparing For Growth 16.04.2021 1
Spotify
Preparing for Growth
Architecting Giant Apps for Scalability and Build Speed


Bruno Rocha - iOS Engineer @ Spotify
2
Preparing For Growth 16.04.2021
Spotify
How does an iOS app
evolve overtime?
Preparing For Growth 16.04.2021 3
Spotify
"Level 1" app


A monolith
All Classes All Resources
Features


- Single module


- MVC


- Simple features


- No testing


- Direct navigation
MyAppModule
Preparing For Growth 16.04.2021 4
Spotify
"Level 2" app


A larger (but better) monolith
MyAppModule
Feature1 Feature2
Feature3 Feature4
Feature5 Feature6
Feature7 Feature8
The app is now larger, but not
large enough to be a big issue
New Features


- Usage of protocols and composition


- A more testable architecture


- Features are slightly more complex


- Presence of unit testing


- Navigation with injection
Preparing For Growth 16.04.2021 5
Spotify
Feature
Feature
Feature
Feature
Feature
Feature
Feature
Feature
Feature
Feature
Feature Feature
MyAppModule
⚠ Slow build times!
Module cache invalidated!
Preparing For Growth 16.04.2021 6
Spotify
Onboarding
"Level 3" app


A modularized app
Home
FeatureFlags NetworkSDK
New Features


- More modules means less cache
misses


- Compilation of modules individually


- Better structure/division of concerns
in general

Recommended

Intro to UIKit • Made by Many
Intro to UIKit • Made by ManyIntro to UIKit • Made by Many
Intro to UIKit • Made by Manykenatmxm
 
Keeping Swift Apps Small
Keeping Swift Apps SmallKeeping Swift Apps Small
Keeping Swift Apps SmallBruno Rocha
 
Swift in SwiftUI
Swift in SwiftUISwift in SwiftUI
Swift in SwiftUIBongwon Lee
 
Native, Web or Hybrid Mobile App Development?
Native, Web or Hybrid Mobile App Development?Native, Web or Hybrid Mobile App Development?
Native, Web or Hybrid Mobile App Development?Sura Gonzalez
 
Deep dive into swift UI
Deep dive into swift UIDeep dive into swift UI
Deep dive into swift UIOsamaGamal26
 
Multiplatform architecture ribs in swift
Multiplatform architecture ribs in swiftMultiplatform architecture ribs in swift
Multiplatform architecture ribs in swiftNAVER Engineering
 
Kotlin Basics & Introduction to Jetpack Compose.pptx
Kotlin Basics & Introduction to Jetpack Compose.pptxKotlin Basics & Introduction to Jetpack Compose.pptx
Kotlin Basics & Introduction to Jetpack Compose.pptxtakshilkunadia
 

More Related Content

What's hot

Flutter overview - advantages & disadvantages for business
Flutter overview - advantages & disadvantages for businessFlutter overview - advantages & disadvantages for business
Flutter overview - advantages & disadvantages for businessBartosz Kosarzycki
 
Introduction to SQLite: The Most Popular Database in the World
Introduction to SQLite: The Most Popular Database in the WorldIntroduction to SQLite: The Most Popular Database in the World
Introduction to SQLite: The Most Popular Database in the Worldjkreibich
 
Data Persistence in Android with Room Library
Data Persistence in Android with Room LibraryData Persistence in Android with Room Library
Data Persistence in Android with Room LibraryReinvently
 
Unity XR platform has a new architecture – Unite Copenhagen 2019
Unity XR platform has a new architecture – Unite Copenhagen 2019Unity XR platform has a new architecture – Unite Copenhagen 2019
Unity XR platform has a new architecture – Unite Copenhagen 2019Unity Technologies
 
iOS Modular Architecture with Tuist
iOS Modular Architecture with TuistiOS Modular Architecture with Tuist
iOS Modular Architecture with Tuist정민 안
 
Introduction to Ionic framework
Introduction to Ionic frameworkIntroduction to Ionic framework
Introduction to Ionic frameworkShyjal Raazi
 
Layer architecture of ios (1)
Layer architecture of ios (1)Layer architecture of ios (1)
Layer architecture of ios (1)dwipalp
 
VueJS Best Practices
VueJS Best PracticesVueJS Best Practices
VueJS Best PracticesFatih Acet
 
Jetpack Compose.pptx
Jetpack Compose.pptxJetpack Compose.pptx
Jetpack Compose.pptxGDSCVJTI
 
android sqlite
android sqliteandroid sqlite
android sqliteDeepa Rani
 
Android testing
Android testingAndroid testing
Android testingJinaTm
 
MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )Ahmed Emad
 
Swift programming language
Swift programming languageSwift programming language
Swift programming languageNijo Job
 
MVVM with Dependency Injection
MVVM with Dependency InjectionMVVM with Dependency Injection
MVVM with Dependency InjectionyahyaSadiiq
 
Android jetpack compose | Declarative UI
Android jetpack compose | Declarative UI Android jetpack compose | Declarative UI
Android jetpack compose | Declarative UI Ajinkya Saswade
 
Basic iOS Training with SWIFT - Part 1
Basic iOS Training with SWIFT - Part 1Basic iOS Training with SWIFT - Part 1
Basic iOS Training with SWIFT - Part 1Manoj Ellappan
 

What's hot (20)

iOS Introduction For Very Beginners
iOS Introduction For Very BeginnersiOS Introduction For Very Beginners
iOS Introduction For Very Beginners
 
Android Threading
Android ThreadingAndroid Threading
Android Threading
 
Flutter overview - advantages & disadvantages for business
Flutter overview - advantages & disadvantages for businessFlutter overview - advantages & disadvantages for business
Flutter overview - advantages & disadvantages for business
 
Ios development
Ios developmentIos development
Ios development
 
Introduction to SQLite: The Most Popular Database in the World
Introduction to SQLite: The Most Popular Database in the WorldIntroduction to SQLite: The Most Popular Database in the World
Introduction to SQLite: The Most Popular Database in the World
 
Data Persistence in Android with Room Library
Data Persistence in Android with Room LibraryData Persistence in Android with Room Library
Data Persistence in Android with Room Library
 
Flutter
FlutterFlutter
Flutter
 
Unity XR platform has a new architecture – Unite Copenhagen 2019
Unity XR platform has a new architecture – Unite Copenhagen 2019Unity XR platform has a new architecture – Unite Copenhagen 2019
Unity XR platform has a new architecture – Unite Copenhagen 2019
 
iOS Modular Architecture with Tuist
iOS Modular Architecture with TuistiOS Modular Architecture with Tuist
iOS Modular Architecture with Tuist
 
Introduction to Ionic framework
Introduction to Ionic frameworkIntroduction to Ionic framework
Introduction to Ionic framework
 
Layer architecture of ios (1)
Layer architecture of ios (1)Layer architecture of ios (1)
Layer architecture of ios (1)
 
VueJS Best Practices
VueJS Best PracticesVueJS Best Practices
VueJS Best Practices
 
Jetpack Compose.pptx
Jetpack Compose.pptxJetpack Compose.pptx
Jetpack Compose.pptx
 
android sqlite
android sqliteandroid sqlite
android sqlite
 
Android testing
Android testingAndroid testing
Android testing
 
MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )
 
Swift programming language
Swift programming languageSwift programming language
Swift programming language
 
MVVM with Dependency Injection
MVVM with Dependency InjectionMVVM with Dependency Injection
MVVM with Dependency Injection
 
Android jetpack compose | Declarative UI
Android jetpack compose | Declarative UI Android jetpack compose | Declarative UI
Android jetpack compose | Declarative UI
 
Basic iOS Training with SWIFT - Part 1
Basic iOS Training with SWIFT - Part 1Basic iOS Training with SWIFT - Part 1
Basic iOS Training with SWIFT - Part 1
 

Similar to Preparing for Growth - Architecting Giant Apps for Scalability and Build Speed

Christopher Allen’s Presentation at eComm 2009
Christopher Allen’s Presentation at eComm 2009Christopher Allen’s Presentation at eComm 2009
Christopher Allen’s Presentation at eComm 2009eCommConf
 
Liferay Italy Symposium 2015 Liferay Mobile SDK and Liferay Screens
Liferay Italy Symposium 2015 Liferay Mobile SDK and Liferay ScreensLiferay Italy Symposium 2015 Liferay Mobile SDK and Liferay Screens
Liferay Italy Symposium 2015 Liferay Mobile SDK and Liferay ScreensDenis Signoretto
 
Spring Boot with Kotlin, Kofu and Coroutines
 Spring Boot with Kotlin, Kofu and Coroutines Spring Boot with Kotlin, Kofu and Coroutines
Spring Boot with Kotlin, Kofu and CoroutinesVMware Tanzu
 
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019Eugene Kurko
 
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019UA Mobile
 
Z sap boe-2016-techws-04_vs_fiori-app-with-eclipseluna-accessing-zsap-system
Z sap boe-2016-techws-04_vs_fiori-app-with-eclipseluna-accessing-zsap-systemZ sap boe-2016-techws-04_vs_fiori-app-with-eclipseluna-accessing-zsap-system
Z sap boe-2016-techws-04_vs_fiori-app-with-eclipseluna-accessing-zsap-systemNagendra Babu
 
Christopher Allen's Presentation at eComm 2009
Christopher Allen's Presentation at eComm 2009Christopher Allen's Presentation at eComm 2009
Christopher Allen's Presentation at eComm 2009eCommConf
 
.NET Application Modernization with PAS and Azure DevOps
.NET Application Modernization with PAS and Azure DevOps.NET Application Modernization with PAS and Azure DevOps
.NET Application Modernization with PAS and Azure DevOpsVMware Tanzu
 
Microsoft silverlight : top 10 features
Microsoft silverlight : top 10 features Microsoft silverlight : top 10 features
Microsoft silverlight : top 10 features Diya Singh
 
MOCA iBeacons SDK for iOS 7
MOCA iBeacons SDK for iOS 7MOCA iBeacons SDK for iOS 7
MOCA iBeacons SDK for iOS 7MOCA Platform
 
Top Cordova Challenges and How to Tackle Them
Top Cordova Challenges and How to Tackle ThemTop Cordova Challenges and How to Tackle Them
Top Cordova Challenges and How to Tackle ThemIonic Framework
 
Mobilefirst - Build Enterprise Class Apps for Mobile First
Mobilefirst - Build Enterprise Class Apps for Mobile First Mobilefirst - Build Enterprise Class Apps for Mobile First
Mobilefirst - Build Enterprise Class Apps for Mobile First Sanjeev Kumar
 
Claromentis Tech RoadMap 2015
Claromentis Tech RoadMap 2015Claromentis Tech RoadMap 2015
Claromentis Tech RoadMap 2015claromentis
 
Eclipse Demo Camp 2010 - Eclipse e4 – The Status and the Future
Eclipse Demo Camp 2010 - Eclipse e4 – The Status and the FutureEclipse Demo Camp 2010 - Eclipse e4 – The Status and the Future
Eclipse Demo Camp 2010 - Eclipse e4 – The Status and the FutureTonny Madsen
 
Build PWA with Ionic Toolkit
Build PWA with Ionic ToolkitBuild PWA with Ionic Toolkit
Build PWA with Ionic ToolkitPavel Kurnosov
 

Similar to Preparing for Growth - Architecting Giant Apps for Scalability and Build Speed (20)

Christopher Allen’s Presentation at eComm 2009
Christopher Allen’s Presentation at eComm 2009Christopher Allen’s Presentation at eComm 2009
Christopher Allen’s Presentation at eComm 2009
 
Codename one
Codename oneCodename one
Codename one
 
Liferay Italy Symposium 2015 Liferay Mobile SDK and Liferay Screens
Liferay Italy Symposium 2015 Liferay Mobile SDK and Liferay ScreensLiferay Italy Symposium 2015 Liferay Mobile SDK and Liferay Screens
Liferay Italy Symposium 2015 Liferay Mobile SDK and Liferay Screens
 
Spring Boot with Kotlin, Kofu and Coroutines
 Spring Boot with Kotlin, Kofu and Coroutines Spring Boot with Kotlin, Kofu and Coroutines
Spring Boot with Kotlin, Kofu and Coroutines
 
Ionic2 First Lesson of Four
Ionic2 First Lesson of FourIonic2 First Lesson of Four
Ionic2 First Lesson of Four
 
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
 
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
 
Z sap boe-2016-techws-04_vs_fiori-app-with-eclipseluna-accessing-zsap-system
Z sap boe-2016-techws-04_vs_fiori-app-with-eclipseluna-accessing-zsap-systemZ sap boe-2016-techws-04_vs_fiori-app-with-eclipseluna-accessing-zsap-system
Z sap boe-2016-techws-04_vs_fiori-app-with-eclipseluna-accessing-zsap-system
 
Christopher Allen's Presentation at eComm 2009
Christopher Allen's Presentation at eComm 2009Christopher Allen's Presentation at eComm 2009
Christopher Allen's Presentation at eComm 2009
 
.NET Application Modernization with PAS and Azure DevOps
.NET Application Modernization with PAS and Azure DevOps.NET Application Modernization with PAS and Azure DevOps
.NET Application Modernization with PAS and Azure DevOps
 
Microsoft silverlight : top 10 features
Microsoft silverlight : top 10 features Microsoft silverlight : top 10 features
Microsoft silverlight : top 10 features
 
Sap mobility training
Sap mobility trainingSap mobility training
Sap mobility training
 
Sap mobility training
Sap mobility trainingSap mobility training
Sap mobility training
 
MOCA iBeacons SDK for iOS 7
MOCA iBeacons SDK for iOS 7MOCA iBeacons SDK for iOS 7
MOCA iBeacons SDK for iOS 7
 
Testing soap UI
Testing soap UITesting soap UI
Testing soap UI
 
Top Cordova Challenges and How to Tackle Them
Top Cordova Challenges and How to Tackle ThemTop Cordova Challenges and How to Tackle Them
Top Cordova Challenges and How to Tackle Them
 
Mobilefirst - Build Enterprise Class Apps for Mobile First
Mobilefirst - Build Enterprise Class Apps for Mobile First Mobilefirst - Build Enterprise Class Apps for Mobile First
Mobilefirst - Build Enterprise Class Apps for Mobile First
 
Claromentis Tech RoadMap 2015
Claromentis Tech RoadMap 2015Claromentis Tech RoadMap 2015
Claromentis Tech RoadMap 2015
 
Eclipse Demo Camp 2010 - Eclipse e4 – The Status and the Future
Eclipse Demo Camp 2010 - Eclipse e4 – The Status and the FutureEclipse Demo Camp 2010 - Eclipse e4 – The Status and the Future
Eclipse Demo Camp 2010 - Eclipse e4 – The Status and the Future
 
Build PWA with Ionic Toolkit
Build PWA with Ionic ToolkitBuild PWA with Ionic Toolkit
Build PWA with Ionic Toolkit
 

Recently uploaded

Deep Learning For Computer Vision- Day 3 Study Jams GDSC Unsri.pptx
Deep Learning For Computer Vision- Day 3 Study Jams GDSC Unsri.pptxDeep Learning For Computer Vision- Day 3 Study Jams GDSC Unsri.pptx
Deep Learning For Computer Vision- Day 3 Study Jams GDSC Unsri.pptxpmgdscunsri
 
Pre-assessment & Data Sheet presentation template - 2023.pptx
Pre-assessment & Data Sheet presentation template - 2023.pptxPre-assessment & Data Sheet presentation template - 2023.pptx
Pre-assessment & Data Sheet presentation template - 2023.pptxssuserc79a6f
 
Architectural Preservation - Heritage, focused on Saudi Arabia
Architectural Preservation - Heritage, focused on Saudi ArabiaArchitectural Preservation - Heritage, focused on Saudi Arabia
Architectural Preservation - Heritage, focused on Saudi ArabiaIgnacio J. Palma, Arch PhD.
 
Microstrip Bandpass Filter Design using EDA Tolol such as keysight ADS and An...
Microstrip Bandpass Filter Design using EDA Tolol such as keysight ADS and An...Microstrip Bandpass Filter Design using EDA Tolol such as keysight ADS and An...
Microstrip Bandpass Filter Design using EDA Tolol such as keysight ADS and An...GauravBhartie
 
sahana sri D AD21046 SELF INTRODUCTION.pdf
sahana sri D AD21046 SELF INTRODUCTION.pdfsahana sri D AD21046 SELF INTRODUCTION.pdf
sahana sri D AD21046 SELF INTRODUCTION.pdfsahanaaids46
 
Objectives of Software Engineering and phases of SDLC.pptx
Objectives of Software Engineering and phases of SDLC.pptxObjectives of Software Engineering and phases of SDLC.pptx
Objectives of Software Engineering and phases of SDLC.pptxGraceDenial
 
STRETCHABLE STRAIN SENSORS BASED ON POLYPYRROLE AND THERMOPLASTIC POLYURETHAN...
STRETCHABLE STRAIN SENSORS BASED ON POLYPYRROLE AND THERMOPLASTIC POLYURETHAN...STRETCHABLE STRAIN SENSORS BASED ON POLYPYRROLE AND THERMOPLASTIC POLYURETHAN...
STRETCHABLE STRAIN SENSORS BASED ON POLYPYRROLE AND THERMOPLASTIC POLYURETHAN...MianHusnainIqbal2
 
SATHVIKA A AD21049 SELF INTRODUCTION.pdf
SATHVIKA A AD21049 SELF INTRODUCTION.pdfSATHVIKA A AD21049 SELF INTRODUCTION.pdf
SATHVIKA A AD21049 SELF INTRODUCTION.pdfSathvikaAlagar
 
Fundamentals of Data Structure_Unit I.pptx
Fundamentals of Data Structure_Unit I.pptxFundamentals of Data Structure_Unit I.pptx
Fundamentals of Data Structure_Unit I.pptxDr. Madhuri Jawale
 
Searching and Sorting Unit II Part I.pptx
Searching and Sorting Unit II Part I.pptxSearching and Sorting Unit II Part I.pptx
Searching and Sorting Unit II Part I.pptxDr. Madhuri Jawale
 
BHUSHAN STEEL.pdf BROCHURE FOR STEEL TABLE
BHUSHAN STEEL.pdf BROCHURE FOR STEEL TABLEBHUSHAN STEEL.pdf BROCHURE FOR STEEL TABLE
BHUSHAN STEEL.pdf BROCHURE FOR STEEL TABLEKuberBhusal1
 
Final Year Project - Automated web based form filling using OCR.pptx
Final Year Project - Automated web based form filling using OCR.pptxFinal Year Project - Automated web based form filling using OCR.pptx
Final Year Project - Automated web based form filling using OCR.pptxswarajkakade83
 
Metrology Measurements and All units PPT
Metrology Measurements and  All units PPTMetrology Measurements and  All units PPT
Metrology Measurements and All units PPTdinesh babu
 
Sample Case Study of industry 4.0 and its Outcome
Sample Case Study of industry 4.0 and its OutcomeSample Case Study of industry 4.0 and its Outcome
Sample Case Study of industry 4.0 and its OutcomeHarshith A S
 
chap. 3. lipid deterioration oil and fat processign
chap. 3. lipid deterioration oil and fat processignchap. 3. lipid deterioration oil and fat processign
chap. 3. lipid deterioration oil and fat processignteddymebratie
 
Introduction about Technology roadmap for Industry 4.0
Introduction about Technology roadmap for Industry 4.0Introduction about Technology roadmap for Industry 4.0
Introduction about Technology roadmap for Industry 4.0RaishKhanji
 
self introduction sri balaji
self introduction sri balajiself introduction sri balaji
self introduction sri balajiSriBalaji891607
 
ROBOT PERCEPTION FOR AGRICULTURE AND GOOD PRODUCTION1.1.pdf
ROBOT PERCEPTION FOR AGRICULTURE AND GOOD PRODUCTION1.1.pdfROBOT PERCEPTION FOR AGRICULTURE AND GOOD PRODUCTION1.1.pdf
ROBOT PERCEPTION FOR AGRICULTURE AND GOOD PRODUCTION1.1.pdfRudraPratapSingh871925
 

Recently uploaded (20)

Deep Learning For Computer Vision- Day 3 Study Jams GDSC Unsri.pptx
Deep Learning For Computer Vision- Day 3 Study Jams GDSC Unsri.pptxDeep Learning For Computer Vision- Day 3 Study Jams GDSC Unsri.pptx
Deep Learning For Computer Vision- Day 3 Study Jams GDSC Unsri.pptx
 
Pre-assessment & Data Sheet presentation template - 2023.pptx
Pre-assessment & Data Sheet presentation template - 2023.pptxPre-assessment & Data Sheet presentation template - 2023.pptx
Pre-assessment & Data Sheet presentation template - 2023.pptx
 
IGBT.ppt
IGBT.pptIGBT.ppt
IGBT.ppt
 
Power System - Types of Power Plants overview
Power System - Types of Power Plants  overviewPower System - Types of Power Plants  overview
Power System - Types of Power Plants overview
 
Architectural Preservation - Heritage, focused on Saudi Arabia
Architectural Preservation - Heritage, focused on Saudi ArabiaArchitectural Preservation - Heritage, focused on Saudi Arabia
Architectural Preservation - Heritage, focused on Saudi Arabia
 
Microstrip Bandpass Filter Design using EDA Tolol such as keysight ADS and An...
Microstrip Bandpass Filter Design using EDA Tolol such as keysight ADS and An...Microstrip Bandpass Filter Design using EDA Tolol such as keysight ADS and An...
Microstrip Bandpass Filter Design using EDA Tolol such as keysight ADS and An...
 
sahana sri D AD21046 SELF INTRODUCTION.pdf
sahana sri D AD21046 SELF INTRODUCTION.pdfsahana sri D AD21046 SELF INTRODUCTION.pdf
sahana sri D AD21046 SELF INTRODUCTION.pdf
 
Objectives of Software Engineering and phases of SDLC.pptx
Objectives of Software Engineering and phases of SDLC.pptxObjectives of Software Engineering and phases of SDLC.pptx
Objectives of Software Engineering and phases of SDLC.pptx
 
STRETCHABLE STRAIN SENSORS BASED ON POLYPYRROLE AND THERMOPLASTIC POLYURETHAN...
STRETCHABLE STRAIN SENSORS BASED ON POLYPYRROLE AND THERMOPLASTIC POLYURETHAN...STRETCHABLE STRAIN SENSORS BASED ON POLYPYRROLE AND THERMOPLASTIC POLYURETHAN...
STRETCHABLE STRAIN SENSORS BASED ON POLYPYRROLE AND THERMOPLASTIC POLYURETHAN...
 
SATHVIKA A AD21049 SELF INTRODUCTION.pdf
SATHVIKA A AD21049 SELF INTRODUCTION.pdfSATHVIKA A AD21049 SELF INTRODUCTION.pdf
SATHVIKA A AD21049 SELF INTRODUCTION.pdf
 
Fundamentals of Data Structure_Unit I.pptx
Fundamentals of Data Structure_Unit I.pptxFundamentals of Data Structure_Unit I.pptx
Fundamentals of Data Structure_Unit I.pptx
 
Searching and Sorting Unit II Part I.pptx
Searching and Sorting Unit II Part I.pptxSearching and Sorting Unit II Part I.pptx
Searching and Sorting Unit II Part I.pptx
 
BHUSHAN STEEL.pdf BROCHURE FOR STEEL TABLE
BHUSHAN STEEL.pdf BROCHURE FOR STEEL TABLEBHUSHAN STEEL.pdf BROCHURE FOR STEEL TABLE
BHUSHAN STEEL.pdf BROCHURE FOR STEEL TABLE
 
Final Year Project - Automated web based form filling using OCR.pptx
Final Year Project - Automated web based form filling using OCR.pptxFinal Year Project - Automated web based form filling using OCR.pptx
Final Year Project - Automated web based form filling using OCR.pptx
 
Metrology Measurements and All units PPT
Metrology Measurements and  All units PPTMetrology Measurements and  All units PPT
Metrology Measurements and All units PPT
 
Sample Case Study of industry 4.0 and its Outcome
Sample Case Study of industry 4.0 and its OutcomeSample Case Study of industry 4.0 and its Outcome
Sample Case Study of industry 4.0 and its Outcome
 
chap. 3. lipid deterioration oil and fat processign
chap. 3. lipid deterioration oil and fat processignchap. 3. lipid deterioration oil and fat processign
chap. 3. lipid deterioration oil and fat processign
 
Introduction about Technology roadmap for Industry 4.0
Introduction about Technology roadmap for Industry 4.0Introduction about Technology roadmap for Industry 4.0
Introduction about Technology roadmap for Industry 4.0
 
self introduction sri balaji
self introduction sri balajiself introduction sri balaji
self introduction sri balaji
 
ROBOT PERCEPTION FOR AGRICULTURE AND GOOD PRODUCTION1.1.pdf
ROBOT PERCEPTION FOR AGRICULTURE AND GOOD PRODUCTION1.1.pdfROBOT PERCEPTION FOR AGRICULTURE AND GOOD PRODUCTION1.1.pdf
ROBOT PERCEPTION FOR AGRICULTURE AND GOOD PRODUCTION1.1.pdf
 

Preparing for Growth - Architecting Giant Apps for Scalability and Build Speed

  • 1. Preparing For Growth 16.04.2021 1 Spotify Preparing for Growth Architecting Giant Apps for Scalability and Build Speed Bruno Rocha - iOS Engineer @ Spotify
  • 2. 2 Preparing For Growth 16.04.2021 Spotify How does an iOS app evolve overtime?
  • 3. Preparing For Growth 16.04.2021 3 Spotify "Level 1" app A monolith All Classes All Resources Features - Single module - MVC - Simple features - No testing - Direct navigation MyAppModule
  • 4. Preparing For Growth 16.04.2021 4 Spotify "Level 2" app A larger (but better) monolith MyAppModule Feature1 Feature2 Feature3 Feature4 Feature5 Feature6 Feature7 Feature8 The app is now larger, but not large enough to be a big issue New Features - Usage of protocols and composition - A more testable architecture - Features are slightly more complex - Presence of unit testing - Navigation with injection
  • 5. Preparing For Growth 16.04.2021 5 Spotify Feature Feature Feature Feature Feature Feature Feature Feature Feature Feature Feature Feature MyAppModule ⚠ Slow build times! Module cache invalidated!
  • 6. Preparing For Growth 16.04.2021 6 Spotify Onboarding "Level 3" app A modularized app Home FeatureFlags NetworkSDK New Features - More modules means less cache misses - Compilation of modules individually - Better structure/division of concerns in general
  • 7. Preparing For Growth 16.04.2021 7 Spotify Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module New... features? - ⚠ Slow build times! (...again?) - ⚠ Awful launch times - ⚠ Small changes are impossible - ⚠ Navigation changes are almost impossible - ⚠ Architectural changes are impossible - ⚠ Isolated development compiles half the app
  • 8. Preparing For Growth 16.04.2021 8 Spotify Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Level 1 problems: Quantity of code Level 2 problems: Testability of code Level 3 problems: Structure/Isolation of code Level 4 problems: Module architecture
  • 9. Preparing For Growth 16.04.2021 9 Spotify Dynamic Frameworks .dylibs loading in runtime might cause launch performance issues Each additional framework that your app loads adds to the launch time. Although dyld caches a lot of this work in a launch closure when the user installs the app, the size of the launch closure and the amount of work done after loading it still depend on the number and sizes of the libraries loaded. Linking Static Libraries instead can improve launch time Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module
  • 10. Preparing For Growth 16.04.2021 10 Spotify Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module
  • 11. Preparing For Growth 16.04.2021 11 Spotify Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module
  • 12. Preparing For Growth 16.04.2021 12 Spotify Direct Dependencies Directly depending on concrete implementation modules makes cache invalidation more common and makes the app inflexible (harder to add new screens in the middle of the flow) Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module
  • 13. Preparing For Growth 16.04.2021 13 Spotify Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module Module 👑 Minions, destroy this app.
  • 14. Preparing For Growth 16.04.2021 14 Spotify Module Module Module Module Now: Horizontal Dependencies Module Module Previous:Vertical Dependencies Module Module
  • 15. Preparing For Growth 16.04.2021 15 Spotify Module Module Module Module "Level 4" app Modules don’t depend on each other, navigation is dynamic Module Module Module Module Module Module Module Module UI
  • 16. Preparing For Growth 16.04.2021 16 Spotify Classes / Structs Protocols Feature Feature Classes / Structs Protocols Feature2 ❔
  • 17. Preparing For Growth 16.04.2021 17 Spotify Protocols FeatureAPI Classes/Structs Feature (Concrete) Protocols Feature2API Classes/Structs Feature2 (Concrete) Concrete modules shouldn’t depend on other concrete modules! API/Impl Module Pair Incremental build time issues may still exist when making changes directly in the API modules, but they are now a much rarer occurrence.
  • 18. Preparing For Growth 16.04.2021 18 Spotify Protocols FeatureAPI Classes/Structs Feature (Concrete) Protocols Feature2API Classes/Structs Feature2 (Concrete) How to navigate to Feature2? Dependency Engine
  • 19. Preparing For Growth 16.04.2021 19 Spotify Feature FeatureAPI Feature FeatureAPI Feature FeatureAPI Feature FeatureAPI Feature FeatureAPI Feature FeatureAPI AppDelegateModule (.app) 🗒 ClassList 🗒 APIRequest ConcreteClass
  • 20. Preparing For Growth 16.04.2021 20 Spotify SPTServiceSystem Manages a graph of SPTServices, working as a runtime dependency injector that handles the lifecycle of every Spotify feature. Feature FeatureAPI Feature FeatureAPI Feature FeatureAPI Feature FeatureAPI Feature FeatureAPI Feature FeatureAPI MainModule (.app) 🗒 ClassList
  • 21. Preparing For Growth 16.04.2021 21 Spotify Networking (Concrete) NetworkService: NetworkAPI AppDelegateModule (.app) (SPTServiceSystem) Hey! I have a service that implements "NetworkAPI". 👍 HomeModule Hey! Can you provide me the impl of "NetworkAPI"? 👍 
 (Inject "NetworkService")
  • 22. Preparing For Growth 16.04.2021 22 Spotify Service Scopes A group of services, allowing fine-grained service access control. 1 2 3 4 LoggedInScope 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 LaunchScope CarPlayScope SiriScope HomeScope
  • 23. Preparing For Growth 16.04.2021 23 Spotify final class SiriIntentsService: SPTService, SiriIntentsAPI { 
 



 } func load() { print(”SiriService loaded”) } func unload() { 
 print(”SiriService unloading”) } static let serviceIdentifier= SiriIntentsAPI.self @Dependencyvar connectivity: ConnectivityAPI @Dependencyvar keychain: KeychainAPI import ConnectivityFeatureAPI import KeychainFeatureAPI
  • 24. Preparing For Growth 16.04.2021 24 Spotify features/siriintents/services.yaml - SiriIntentsService (SiriScope) - MyService (MyScope) - MyOtherService (MyScope) - MySuperSecretFeatureSerice (MyScope)
  • 25. Preparing For Growth 16.04.2021 25 Spotify let serviceList = SPTServiceList() 
 let serviceOrchestrator = ServiceOrchestrator(services: serviceList) 1 2 3 4 5 6 7 8 Directed Acyclic Graph (DAG) [8, 7, 6, 4, 2, 5, 3, 1] Load/Notify Order Unload Order (Topologically Sorted)
  • 26. Preparing For Growth 16.04.2021 26 Spotify let serviceList = SPTServiceList() 
 let serviceOrchestrator = ServiceOrchestrator(services: serviceList) 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 Not in memory Lazy reference injected Loaded in memory serviceOrchestrator.activate(scope: "LaunchScope") serviceOrchestrator.load(NavigationService.self, fromScope: "LaunchScope") serviceOrchestrator.load(CrashReporterService.self, fromScope: "LaunchScope")
  • 27. Preparing For Growth 16.04.2021 27 Spotify serviceOrchestrator.deactivate(scope: ”CarPlayScope”) 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 LaunchScope LoggedInScope CarPlayScope 1 2 3 4 5 6 7 8
  • 28. 28 Preparing For Growth 16.04.2021 Spotify Isolated Development 
 (Mini apps)
  • 29. Preparing For Growth 16.04.2021 29 Spotify FeatureA FeatureAAPI FeatureBAPI FeatureB FeatureC FeatureCAPI FeatureD FeatureDAPI FakeFeatureB MyApp
  • 30. Preparing For Growth 16.04.2021 30 Spotify FeatureA FeatureAAPI FeatureBAPI FakeFeatureB FeatureADemoApp
  • 31. Preparing For Growth 16.04.2021 31 Spotify Mini Apps Horizontal dependencies allow the creation of minified example apps. Huge productivity boost! FeatureA FeatureAAPI FeatureBAPI FakeFeatureB FeatureADemoApp
  • 32. 32 Preparing For Growth 16.04.2021 Spotify Dynamic Navigation
  • 33. Preparing For Growth 16.04.2021 33 Spotify Module Module Module Module Dynamic Navigation Not having explicit dependencies mean we can go anywhere from anywhere Module Module Module Module Module Module Module Module UI
  • 34. Preparing For Growth 16.04.2021 34 Spotify final class ProfilePage: SPTService, ProfilePageAPI { 
 


 } func load() { navigation.register(”page-profile”) { _ in 
 return ProfileViewController() 
 } } static let serviceIdentifier= ProfilePageAPI.self @Dependencyvar navigation: NavigationAPI import NavigationFeatureAPI
  • 35. Preparing For Growth 16.04.2021 35 Spotify func navigateToProfile() { navigation.push(”page-profile”) }
  • 36. Preparing For Growth 16.04.2021 36 Spotify Backend-Driven UI page-playlist?id=f8sn03k page-playlist?id=v92kalp page-charts page-new page-videos page-podcasts (HubsRenderer)
  • 37. Preparing For Growth 16.04.2021 37 Spotify iOS App Evolution Amount of issues when evolving Level 1 Level 2 Level 3 Level 4 Level 5 No issues! Some issues. Some bigger issues. TONS of issues. ????
  • 38. Preparing For Growth 16.04.2021 38 Spotify @rockbruno_