SlideShare a Scribd company logo
1 of 37
Download to read offline
Creating An App for 650
million customers
AnchorFree in Numbers
● 20M DAU, 650M total active
● Two Apps in Top 10 at US App Store
● 6+ Cross-platform Apps (iOS, Android, Desktop)
● 2+ acquired competitors
Different UI – similar features
What we had previously?
● The Good
○ Split repos per application
● The Bad
○ Dependency Hell
○ No Unified Architectural Approach (but mainly MVC)
● The Ugly
○ Low unit test coverage
○ Huge code duplication between repos
○ Broken CI for months in some repos
The Master Plan
The Master Plan
● Monorepo
● Unified architectural approach
● Stable CI
● Unit-test coverage
● Automated testing
Repositories
Split repos
● The Good
○ Bugs are isolated in application repo
○ Fast & Secure
● The Bad
○ Hard to reuse code
○ Hard to do a large-scale refactoring
● The Ugly
○ Dependency hell on large project
○ Same bugs in every single app
Monorepo
● The Good
○ Great code reuse & large-scale refactoring
○ Manageable dependencies
○ Easy release management
○ Cross-team collaboration
● The Ugly
○ Scalability challenges in CI & VCS
○ Tooling
Our Approach to VCS
● Git as VCS
● GitHub for repo management and
code-reviews
● Pull request naming policy
● Tags naming policy
● Squash-merge to keep git history clean
Our Approach to CI
● CircleCI as CI
● Tests on every PR
● Regular AdHoc releases of all apps
● Release-candidate builds from tags
● An eternal battle to keep builds fast
What we achieved with the monorepo?
● Consistent CI builds of all apps
● Lower regression rate
● Shorter release cycles due to code sharing
When a monorepo may work for you?
● Multiple similar projects in organization
● Poor code reuse between them
● Dependency hell
Unified Architecture
Our Goals
● Different UI design in different apps
● Easily replace system components per application
● Keep new architecture compatible with MVC
● Scale team easily
● Support macOS later
Common Approaches
● MVC
● MVVM (+Coordinator)
● VIPER
MVC
● The Good
○ Simple when the project is small
● The Bad
○ Learning curve for new team member when MVC becomes MVC+whatever
● The Ugly
○ Massive view controllers
○ Hard to unit-test view and controller
○ Team reinvents the wheel all the time
○ A/B tests are undoable
MVVM (+Coordinator)
● The Good:
○ Testability
○ Easy of use
● The Bad:
○ Massive ViewModels
○ Possible God-Object Coordinator
○ A/B testing
● The Ugly:
○ Call Stack during debugging
○ No standard approach to routing
VIPER
● The Good
○ Isolated modules → isolated bugs
○ Short learning curve → easy scale of the team
○ Unit testing is trivial
○ A/B testing of every app component is trivial
○ Standardized architectural approach → no reinvented wheels
● The Bad
○ Heavily missed deadlines at first
○ Lots of boilerplate code
Deadlines With VIPER
High Level Design of our Approach
Lessons Learned with VIPER
● Every VIPER is different
● It’s hard to make VIPER right from scratch
● Use codegen to avoid rewriting of boilerplate code
What we have now?
● The Good
○ Unified architectural approach
○ Low code duplication
○ CI builds of all apps
● The Bad
○ Monorepo with few apps
○ Latest versions of dependencies from git submodules
● The Ugly
○ Low Unit test coverage
Next Steps
1. Achieve better unit test coverage
2. Automate testing process
3. Update apps every 4-6 weeks
4. Build cross-functional teams based on functional blocks
5. Run tens of A/B tests in every release
6. Find the next big (product) thing
7. File the IPO
Let’s stay in touch
/dosipa
dima.osipa@gmail.com
bomjkolyadun
Q&A
https://anchorfree.com/openings/
Yes, we are hiring:
Backup Slides (VIPER)
Assembly
● PONSO – plain old NSObject
● Responsible for injecting dependencies into the module
View
● UIViewController (or NSViewController) subclass
● VIPER’s module facade (to achieve compatibility with MVC)
● Sends events to Presenter
● Receives ViewModels from Presenter
● Receives UIControls style from Theme
Theme
● Swift Enum / PONSO
● Contains styles of all UI Components of the app
Presenter
● PONSO
● Receives events from View
● Sends ViewModels to View
● Sends events to Interactor
● Receives data and events from Interactor
● Sends events to Router
Interactor
● PONSO
● Handles one use-case
● Presenter may contain few interactors
● Receives events from Presenter
● Sends events to Services
● Receives Entities and events from Services
Service
● PONSO
● Interacts with backend
● Manipulates with Entities
● Interactor may interact with one or more services
View Controller Extension
● Method to open ViewController – VIPER Module and inject dependencies
● Method to close ViewController – VIPER module
Why VIPER?
● Great component interchangeability
● Module Isolation
● Trivial Unit-tests
● Short learning curve for new team members
Typical Startup Problems
● How to attract new customers
● How to increase revenue per customer
● How to respond to the competition
● How to build a constant change culture
Let’s stay in touch
/dosipa
dima.osipa@gmail.com
bomjkolyadun

More Related Content

More from UA Mobile

Ідіоматична ін'єкція залежностей на Kotlin без фреймворків - UA Mobile2019
Ідіоматична ін'єкція залежностей на Kotlin без фреймворків - UA Mobile2019Ідіоматична ін'єкція залежностей на Kotlin без фреймворків - UA Mobile2019
Ідіоматична ін'єкція залежностей на Kotlin без фреймворків - UA Mobile2019
UA Mobile
 
До чого прикладати Docker в Android? - UA Mobile 2019
До чого прикладати Docker в Android? - UA Mobile 2019До чого прикладати Docker в Android? - UA Mobile 2019
До чого прикладати Docker в Android? - UA Mobile 2019
UA Mobile
 
Optional. Tips and Tricks - UA Mobile 2019
Optional. Tips and Tricks - UA Mobile 2019Optional. Tips and Tricks - UA Mobile 2019
Optional. Tips and Tricks - UA Mobile 2019
UA Mobile
 
Бібліотеки та Інструменти на сторожі коду - UA Mobile 2019
Бібліотеки та Інструменти на сторожі коду - UA Mobile 2019Бібліотеки та Інструменти на сторожі коду - UA Mobile 2019
Бібліотеки та Інструменти на сторожі коду - UA Mobile 2019
UA Mobile
 
Долаючи прірву між дизайнерами та розробниками - UA Mobile 2019
Долаючи прірву між дизайнерами та розробниками - UA Mobile 2019Долаючи прірву між дизайнерами та розробниками - UA Mobile 2019
Долаючи прірву між дизайнерами та розробниками - UA Mobile 2019
UA Mobile
 

More from UA Mobile (20)

Ідіоматична ін'єкція залежностей на Kotlin без фреймворків - UA Mobile2019
Ідіоматична ін'єкція залежностей на Kotlin без фреймворків - UA Mobile2019Ідіоматична ін'єкція залежностей на Kotlin без фреймворків - UA Mobile2019
Ідіоматична ін'єкція залежностей на Kotlin без фреймворків - UA Mobile2019
 
Актуальні практики дизайну мобільних додатків - UA Mobile 2019
Актуальні практики дизайну мобільних додатків - UA Mobile 2019Актуальні практики дизайну мобільних додатків - UA Mobile 2019
Актуальні практики дизайну мобільних додатків - UA Mobile 2019
 
До чого прикладати Docker в Android? - UA Mobile 2019
До чого прикладати Docker в Android? - UA Mobile 2019До чого прикладати Docker в Android? - UA Mobile 2019
До чого прикладати Docker в Android? - UA Mobile 2019
 
Building your Flutter apps using Redux - UA Mobile 2019
Building your Flutter apps using Redux - UA Mobile 2019Building your Flutter apps using Redux - UA Mobile 2019
Building your Flutter apps using Redux - UA Mobile 2019
 
Optional. Tips and Tricks - UA Mobile 2019
Optional. Tips and Tricks - UA Mobile 2019Optional. Tips and Tricks - UA Mobile 2019
Optional. Tips and Tricks - UA Mobile 2019
 
Designing iOS+Android project without using multiplatform frameworks - UA Mob...
Designing iOS+Android project without using multiplatform frameworks - UA Mob...Designing iOS+Android project without using multiplatform frameworks - UA Mob...
Designing iOS+Android project without using multiplatform frameworks - UA Mob...
 
Бібліотеки та Інструменти на сторожі коду - UA Mobile 2019
Бібліотеки та Інструменти на сторожі коду - UA Mobile 2019Бібліотеки та Інструменти на сторожі коду - UA Mobile 2019
Бібліотеки та Інструменти на сторожі коду - UA Mobile 2019
 
Flutter: No more boring apps! - UA Mobile 2019
Flutter: No more boring apps! - UA Mobile 2019Flutter: No more boring apps! - UA Mobile 2019
Flutter: No more boring apps! - UA Mobile 2019
 
Долаючи прірву між дизайнерами та розробниками - UA Mobile 2019
Долаючи прірву між дизайнерами та розробниками - UA Mobile 2019Долаючи прірву між дизайнерами та розробниками - UA Mobile 2019
Долаючи прірву між дизайнерами та розробниками - 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
 
Sceneform SDK на практиці - UA Mobile 2019
Sceneform SDK на практиці - UA Mobile 2019Sceneform SDK на практиці - UA Mobile 2019
Sceneform SDK на практиці - UA Mobile 2019
 
Coroutines in Kotlin. UA Mobile 2017.
Coroutines in Kotlin. UA Mobile 2017.Coroutines in Kotlin. UA Mobile 2017.
Coroutines in Kotlin. UA Mobile 2017.
 
Augmented reality on Android. UA Mobile 2017.
Augmented reality on Android. UA Mobile 2017.Augmented reality on Android. UA Mobile 2017.
Augmented reality on Android. UA Mobile 2017.
 
Architecture Patterns in Practice with Kotlin. UA Mobile 2017.
Architecture Patterns in Practice with Kotlin. UA Mobile 2017.Architecture Patterns in Practice with Kotlin. UA Mobile 2017.
Architecture Patterns in Practice with Kotlin. UA Mobile 2017.
 
MVVM with Databinding and Google's new ViewModel. UA Mobile 2017.
MVVM with Databinding and Google's new ViewModel. UA Mobile 2017.MVVM with Databinding and Google's new ViewModel. UA Mobile 2017.
MVVM with Databinding and Google's new ViewModel. UA Mobile 2017.
 
Enhance your world with ARKit. UA Mobile 2017.
Enhance your world with ARKit. UA Mobile 2017.Enhance your world with ARKit. UA Mobile 2017.
Enhance your world with ARKit. UA Mobile 2017.
 
FormsKit: reactive forms driven by state. UA Mobile 2017.
FormsKit: reactive forms driven by state. UA Mobile 2017.FormsKit: reactive forms driven by state. UA Mobile 2017.
FormsKit: reactive forms driven by state. UA Mobile 2017.
 
Monadic Computation in Swift. Why? UA Mobile 2017.
Monadic Computation in Swift. Why? UA Mobile 2017.Monadic Computation in Swift. Why? UA Mobile 2017.
Monadic Computation in Swift. Why? UA Mobile 2017.
 
Gems of GameplayKit. UA Mobile 2017.
Gems of GameplayKit. UA Mobile 2017.Gems of GameplayKit. UA Mobile 2017.
Gems of GameplayKit. UA Mobile 2017.
 
Building framework with shared code on Android and iOS using React Native. UA...
Building framework with shared code on Android and iOS using React Native. UA...Building framework with shared code on Android and iOS using React Native. UA...
Building framework with shared code on Android and iOS using React Native. UA...
 

Recently uploaded

Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Cara Menggugurkan Kandungan 087776558899
 

Recently uploaded (6)

Leading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfLeading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdf
 
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
 
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
 
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
 
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
 

Побудова архітектури додатку для 650 мільйонів користувачів - UA Mobile 2019

  • 1. Creating An App for 650 million customers
  • 2. AnchorFree in Numbers ● 20M DAU, 650M total active ● Two Apps in Top 10 at US App Store ● 6+ Cross-platform Apps (iOS, Android, Desktop) ● 2+ acquired competitors
  • 3. Different UI – similar features
  • 4. What we had previously? ● The Good ○ Split repos per application ● The Bad ○ Dependency Hell ○ No Unified Architectural Approach (but mainly MVC) ● The Ugly ○ Low unit test coverage ○ Huge code duplication between repos ○ Broken CI for months in some repos
  • 6. The Master Plan ● Monorepo ● Unified architectural approach ● Stable CI ● Unit-test coverage ● Automated testing
  • 8. Split repos ● The Good ○ Bugs are isolated in application repo ○ Fast & Secure ● The Bad ○ Hard to reuse code ○ Hard to do a large-scale refactoring ● The Ugly ○ Dependency hell on large project ○ Same bugs in every single app
  • 9. Monorepo ● The Good ○ Great code reuse & large-scale refactoring ○ Manageable dependencies ○ Easy release management ○ Cross-team collaboration ● The Ugly ○ Scalability challenges in CI & VCS ○ Tooling
  • 10. Our Approach to VCS ● Git as VCS ● GitHub for repo management and code-reviews ● Pull request naming policy ● Tags naming policy ● Squash-merge to keep git history clean
  • 11. Our Approach to CI ● CircleCI as CI ● Tests on every PR ● Regular AdHoc releases of all apps ● Release-candidate builds from tags ● An eternal battle to keep builds fast
  • 12. What we achieved with the monorepo? ● Consistent CI builds of all apps ● Lower regression rate ● Shorter release cycles due to code sharing
  • 13. When a monorepo may work for you? ● Multiple similar projects in organization ● Poor code reuse between them ● Dependency hell
  • 15. Our Goals ● Different UI design in different apps ● Easily replace system components per application ● Keep new architecture compatible with MVC ● Scale team easily ● Support macOS later
  • 16. Common Approaches ● MVC ● MVVM (+Coordinator) ● VIPER
  • 17. MVC ● The Good ○ Simple when the project is small ● The Bad ○ Learning curve for new team member when MVC becomes MVC+whatever ● The Ugly ○ Massive view controllers ○ Hard to unit-test view and controller ○ Team reinvents the wheel all the time ○ A/B tests are undoable
  • 18. MVVM (+Coordinator) ● The Good: ○ Testability ○ Easy of use ● The Bad: ○ Massive ViewModels ○ Possible God-Object Coordinator ○ A/B testing ● The Ugly: ○ Call Stack during debugging ○ No standard approach to routing
  • 19. VIPER ● The Good ○ Isolated modules → isolated bugs ○ Short learning curve → easy scale of the team ○ Unit testing is trivial ○ A/B testing of every app component is trivial ○ Standardized architectural approach → no reinvented wheels ● The Bad ○ Heavily missed deadlines at first ○ Lots of boilerplate code
  • 21. High Level Design of our Approach
  • 22. Lessons Learned with VIPER ● Every VIPER is different ● It’s hard to make VIPER right from scratch ● Use codegen to avoid rewriting of boilerplate code
  • 23. What we have now? ● The Good ○ Unified architectural approach ○ Low code duplication ○ CI builds of all apps ● The Bad ○ Monorepo with few apps ○ Latest versions of dependencies from git submodules ● The Ugly ○ Low Unit test coverage
  • 24. Next Steps 1. Achieve better unit test coverage 2. Automate testing process 3. Update apps every 4-6 weeks 4. Build cross-functional teams based on functional blocks 5. Run tens of A/B tests in every release 6. Find the next big (product) thing 7. File the IPO
  • 25. Let’s stay in touch /dosipa dima.osipa@gmail.com bomjkolyadun
  • 28. Assembly ● PONSO – plain old NSObject ● Responsible for injecting dependencies into the module
  • 29. View ● UIViewController (or NSViewController) subclass ● VIPER’s module facade (to achieve compatibility with MVC) ● Sends events to Presenter ● Receives ViewModels from Presenter ● Receives UIControls style from Theme
  • 30. Theme ● Swift Enum / PONSO ● Contains styles of all UI Components of the app
  • 31. Presenter ● PONSO ● Receives events from View ● Sends ViewModels to View ● Sends events to Interactor ● Receives data and events from Interactor ● Sends events to Router
  • 32. Interactor ● PONSO ● Handles one use-case ● Presenter may contain few interactors ● Receives events from Presenter ● Sends events to Services ● Receives Entities and events from Services
  • 33. Service ● PONSO ● Interacts with backend ● Manipulates with Entities ● Interactor may interact with one or more services
  • 34. View Controller Extension ● Method to open ViewController – VIPER Module and inject dependencies ● Method to close ViewController – VIPER module
  • 35. Why VIPER? ● Great component interchangeability ● Module Isolation ● Trivial Unit-tests ● Short learning curve for new team members
  • 36. Typical Startup Problems ● How to attract new customers ● How to increase revenue per customer ● How to respond to the competition ● How to build a constant change culture
  • 37. Let’s stay in touch /dosipa dima.osipa@gmail.com bomjkolyadun