Most well known mobile architectures start to work against you after your engineering team grows large. A new architecture paradigm is needed to better support the development of mobile applications with hundreds of mobile enginee
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
Mobile Architecture at Scale
1. Mobile Architecture
at Scale
Why and how we built a new
architecture used by hundreds of
engineers, all in one codebase
18 Jan 2018
Gergely Orosz, Engineering Manager,
Payments, Uber
27. ● Constraints
○ Native development
○ Independent iOS & Android™ codebases
● Opportunities
○ Mobile Platform team
○ iOS & Android monorepos
Constraints & Opportunities
28. ● Isolation & testability
● Developer productivity
● Support continued growth for years
● 99.99% reliability of core flows
● Monitoring as a first class citizen
● De-risk experimentation
Rewrite Goals
40. Dependency Scopes
Application driven by business logic
Root
LoggedInLoggedOut
Onboarding Menu Request
Home
ShortcutsFeedCard
Location
Editor
OnTrip
...
LoggedOut
41. Dependency Scopes
Application driven by business logic
Root
LoggedInLoggedOut
Onboarding Menu Request
Home
ShortcutsFeedCard
Location
Editor
OnTrip
...
42. Dependency Scopes
Application driven by business logic
Root
LoggedInLoggedOut
Onboarding Menu Request
Home
ShortcutsFeedCard
Location
Editor
OnTrip
...
47. ● View tree drives the app hierarchy
● Business logic & view trees are tightly coupled
● Deep scope hierarchies supported only based
on view nesting
MVC, MVP, MVVM, MVI & VIPER
48. (B)VIPER
Making VIPER components reusable
Interactor
Business logic
Router
Route between screens
View(Controller)
Layout & animation
Presenter
UI logic & respond to
user inputs
EntityModule Builder
Creates VIPER classes
49. RIBs
Interactor
Business logic of the app
(aka “the brain”)
Router
Routes between RIBs
View(Controller)
Layout & Animation
Presenter
(Optional)
Translation Logic
View model
UI event
Data model
Business logic calls
Routing calls
Builder
Creates RIB units
56. Data flow with RIBs
ServiceModel Stream Pushes state onto
Service callsData model
Non-state modifying
responses
Logic calls
The Internets
Interactor
Router
View(Controller)Presenter
UI event
View model
Push/pull
Data model
Routing calls
58. Viewless RIBs
ServiceModel Stream Pushes state onto
Service callsData model
Non-state modifying
responses
Logic calls
The Internets
Interactor
Router
View(Controller)Presenter
UI event
View model
Push/pull
Data model
Routing calls
Attach / detach child RIBs
70. ● Code generation
● Onboarding
● Enforcing (architecture)
patterns
Adopting a framework with a large team
● Have a clear owner
71. ● Adopting a framework at scale
● Why RIBs worked
● Summary
Scaling an architecture in practice
72. ● 3 apps, more than 200 developers
● More than 600 RIBs, reused within & across apps
● Less than 300 lines of code / class for most RIBs
● All business logic well unit tested
● Open sourced
How RIBs worked out
73. ● Long dependency injection chains
● Too much (boilerplate) code
● [iOS] RIBs incompatible with plain Views
Feedback from engineers after a year’s usage
74. ● Does your app have lots of non-visual state?
● Do you have a (fast) growing iOS & Android app/team?
● Do you have the bandwidth to invest in a new architecture?
Is RIBs for you?
75. ● Adopting a framework at scale
● Why RIBs worked
● Summary
RIBs in practice