SlideShare a Scribd company logo
1 of 77
Uber’s New Mobile Architecture
Uber Mobility
April 19th, 2017
Why a new architecture?
Tuomas Artman
Uber’s entire mobile team 4 ½ years ago
“What if we changed everything?”
99.99% availability of core flows
Enable global roll-back of core flows to a
guaranteed working state
Testing as a first-class citizen
Architectural goals
99.99% availability of core flows
Enable global roll-back of core flows to a
guaranteed working state
Testing as a first-class citizen
Support Uber’s growth for years to come
Narrow and decouple functionality as much
as possible
Architectural goals
99.99% availability of core flows
Enable global roll-back of core flows to a
guaranteed working state
Testing as a first-class citizen
Support Uber’s growth for years to come
Narrow and decouple functionality as much
as possible
Provide rails for both design and code
Consistency in engineering, consistency in
UX
Architectural goals
99.99% availability of core flows
Enable global roll-back of core flows to a
guaranteed working state
Testing as a first-class citizen
Support Uber’s growth for years to come
Narrow and decouple functionality as much
as possible
Provide rails for both design and code
Consistency in engineering, consistency in
UX
Monitoring is a first-class citizen
Automatic analytics, logging, debugging, and
tracing
Architectural goals
99.99% availability of core flows
Enable global roll-back of core flows to a
guaranteed working state
Testing as a first-class citizen
Support Uber’s growth for years to come
Narrow and decouple functionality as much
as possible
Provide rails for both design and code
Consistency in engineering, consistency in
UX
Monitoring is a first-class citizen
Automatic analytics, logging, debugging, and
tracing
De-risk experimentation
Application framework with Plugin API
Architectural goals
99.99% availability of core flows
Enable global roll-back of core flows to a
guaranteed working state
Testing as a first-class citizen
Support Uber’s growth for years to come
Narrow and decouple functionality as much
as possible
Provide rails for both design and code
Consistency in engineering, consistency in
UX
Monitoring is a first-class citizen
Automatic analytics, logging, debugging, and
tracing
De-risk experimentation
Application framework with Plugin API
Make magic
Performance second to none, graceful
degradation on low-end devices and networks
Architectural goals
Copyright Tsahi Levent-Levi
Multiplatform architecture
Double the effectiveness of teams
Timeline
RIB Architecture Application Framework
Dependency management
Reactive data flows
Scoping
Compartmentalization
Analytics
UI Components
Mapping
Testability Experimentation
Plugins
Threading model
Storage
Location services
Logging
Monitoring
Networking
Routing
Code gen
Business-logic driven
Open source
Deep Scope Hierarchies
Tony Cosentini
Dealing with State
Lots of apps have tricky asynchronous, state issues
At Uber, this compounds quite a bit
Uber’s apps have a lot of asynchronous state, from multiple data sources
150+ contributors
Scopes?
“The lifecycle in which an object exists.”
App Scope
RiderAppDelegate / RiderApplication {
PickupRequestManager
DestinationRefinementStream
DriverLocationMapLayer
… and a lot more stuff…
}
What’s so bad about this?
Stability and Code Quality Impact
Objects that live longer than
necessary are exposed to more
state they don’t need.
In Uber’s apps in particular, many of
these stateful objects observe
different streams of data. This
means these objects might get
frequent updates even when they
aren’t being used.
class DriverIsOnTheirWayToaster {
private boolean isOnTripAndHasNotBeenNotified;
public DriverIsOnTheirWayToaster(TripStateStream
tripStateStream) {
tripStateStream.subscribe({ (state, driver?) ->
if (state == ON_THEIR_WAY {
isOnTripAndHasNotBeenNotified = true;
showToast(driver!.name);
} else if (state == OFF_TRIP) {
isOnTripAndHasNotBeenNotified = false;
}
})
}
}
Input and dependency contracts are diluted
When objects live at app scope,
they cannot have very rigid inputs
and dependencies.
Why does this class take an
optional AuthToken if it’s really
required?
How does this hurt testing?
public class AuthenticatedNetworkRequester {
private AuthToken? authToken;
public void makeRequest() {
networkClient.makeRequest(authToken!)
}
}
Other Issues
While most of the classes are very simple, having lots of objects around for the
entire duration of the app’s lifecycle is not super efficient.
Classes can grow to not have a clear purpose.
Although it wasn’t as bad as some of the examples, there was no standard way
to “scope” singletons and objects to different lifecycles of the app.
Previous Rider App Scope Hierarchy
How do we improve this?
Improvements
Lots of our bugs are state related.
A pattern or framework to encourage creating objects only when relevant would help here.
The view hierarchy doesn’t really line up with business logic.
We should create a hierarchy based on business logic states, which does not necessarily map to
what is on the screen.
There was no easy, consistent way to create your own scopes.
Scopes
Based on business logic
Scopes
Root doesn’t know anything - it can’t
make any assumptions.
Root
Scopes
LoggedIn knows that you have valid
non-null authentication credentials.
Dependencies created and provided
here can take non-null credentials
without having to make any
assumptions.
Root
LoggedIn
Moving AuthenticatedNetworkRequester to LoggedIn Scope
public class AuthenticatedNetworkRequester {
private AuthToken? authToken;
public void makeRequest() {
networkClient.makeRequest(authToken!)
}
}
Moving AuthenticatedNetworkRequester to LoggedIn Scope
AuthToken is now guaranteed to be
available.
Other objects that depend on
AuthenticatedNetworkRequester
need to be in a logged in state to
use it.
If a dependency requires
AuthenticatedNetworkRequester
outside of the LoggedIn scope, it’s
now a compile error.
public class AuthenticatedNetworkRequester {
private AuthToken authToken;
public void makeRequest() {
networkClient.makeRequest(authToken)
}
}
Scopes
OnTrip knows that the user is logged
in and on a trip.
Dependencies created and provided
here can take non-null credentials and
all data related to a trip without having
to make any assumptions.
Root
LoggedIn
OnTrip
Moving DriverIsOnTheirWayToaster to OnTrip Scope
class DriverIsOnTheirWayToaster {
private boolean isOnTripAndHasNotBeenNotified;
public DriverIsOnTheirWayToaster(TripStateStream
tripStateStream) {
tripStateStream.subscribe({ (state, driver?) ->
if (state == ON_THEIR_WAY {
isOnTripAndHasNotBeenNotified = true;
showToast(driver!.name);
} else if (state == OFF_TRIP) {
isOnTripAndHasNotBeenNotified = false;
}
})
}
}
Moving DrvierIsOnTheirWayToaster to OnTrip Scope
Now DrvierIsOnTheirWayToaster is
exposed to much less state - it’s
easier to understand, and less
prone to bugs.
class DriverIsOnTheirWayToaster {
public DriverIsOnTheirWayToaster(Driver driver) {
showToast(driver.name);
}
}
Composable single-responsibility units
Yi Wang
RIB
Massive
ViewController/Fragment
RIB
Composable Single-responsibility Units
RIB
Composable Single-responsibility Units
RIB
Composable Single-responsibility Units
RIB
Composable Single-responsibility Units
RIB
Composable Single-responsibility Units
RIB Tree & Inter-RIB Communication
Composing RIBs into features
RIB Tree & Inter-RIB Communication
Composing RIBs into features
RIB Tree & Inter-RIB Communication
Composing RIBs into features
RIB Tree & Inter-RIB Communication
Composing RIBs into features
RIB Tree & Inter-RIB Communication
Composing RIBs into features
View(Controller) Tree
Composing RIBs into features
What about other architectures?
MVC
● Massive ViewController
● Locked in view tree and business tree
MVVM
● Massive ViewModel
● Locked in view tree and business tree
VIPER
● Logic separation based on view
● Locked in view tree and business tree
What did RIBs give us?
● Rider app broken up into more than 500 RIBs
○ Many are reused with multiple parts of the tree
● All RIBs have less than 300 lines of code per class
● All business logic well unit-tested
Brian Attwell
Plugins
● Support Uber’s growth for years to come?
● Provide rails for both design and code
● De-risk experimentation
Architectural goals
Consider three of our architectural goals:
Support Uber’s growth for years to come
RIBs give us code isolation
We want more code isolation
Code Isolation Example
Code Isolation Example
Code Isolation Example
Code Isolation Example
Code Isolation Example
Support Uber’s growth for years to come
Provide rails for both design and code?
De-risk experimentation
How do Plugins play into Architectural goals?
Consider three of our architectural goals:
Home Screen
Interface:
Router<? extends MapComponent> { }
Example:
NearbyVehiclesMapLayer
PresentLocationMapLayer
CurbsidePickupMapLayer
DestinationRefinementMapLayer
Home Screen
for (HomeMapLayerPlugin plugin: plugins) {
attachChild(plugin.buildRib(component));
}
Home Screen
Interface:
ViewRouter<?> { }
Example:
SnapchatCardRouter
RatingCardRouter
TransitConnectionRouter
EatsCardRouter
PaymentsCardRouter
Interface:
interface LocationRowProvider {
Observable<SearchResult[]> query(input);
}
interface SearchResult {
String tag();
Router buildRouter(parent);
}
Example:
CalendarResultsPlugin
SavedLocationsPlugin
GeoSearchResultsPlugin
FriendsLocationPlugin
Observable
.combineLatest(plugins)
.subscribe(BindLocationRowsConsumer)
@Override
protected void didBecomeActive() {
for (Work worker : mainScopedPluginManager.get()) {
work.start();
}
}
Viewless plugins
Interface:
interface MenuPlugin {
MenuCategory menuCategory();
Router buildRouter(MenuPluginComponent)
}
enum MenuCategory { TOP, BOTTOM }
Example:
PaymentMenuPlugin
FreeRidesPlugin
HelpPlugin
Almost all features in the app can be
written as code that plugs into the
core of the app.
80% of Rider’s Application Layer written as Plugins
New plugin points and changes to core get
extra code reviewers added automatically.
Support Uber’s growth for years to come
Provide rails for both design and code
De-risk experimentation?
How do Plugins play into Architectural goals?
Consider three of our architectural goals:
Derisking Experimentation
Roll out all new features as plugins
Every plugin is initially A/B tested
Every plugin can be disabled from our servers
UI tests ensure the app is still functional when all plugins disabled
De-risking Experimentation
Engineers want to reuse existing plugin points and now know where the
build new features
We’ve prevented six outages in production by disabling plugins
Statically ensured code isolation between the architecturally significant core
of the app and the app’s features
Results
From using plugins
Development Velocity
Able to sustain 500 diffs/week per platform
Diffs landed per week doubled after finishing the four month rewrite
Crash Free Rate
Immediately after releasing the new app, crash rate was better than the old app
iOS crash free free rate of 99.99% and climbing
Android crash free rate of 99.9% and climbing
Performance
App starts 50% faster
Developer Happiness
78.5 developer NPS score improvement
Results
From the new architecture
Thank you
Proprietary and confidential © 2016 Uber Technologies, Inc. All rights reserved. No part of this document may be
reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying, recording, or by any
information storage or retrieval systems, without permission in writing from Uber. This document is intended only for the use
of the individual or entity to whom it is addressed and contains information that is privileged, confidential or otherwise
exempt from disclosure under applicable law. All recipients of this document are notified that the information contained
herein includes proprietary and confidential information of Uber, and recipient may not make use of, disseminate, or in any
way disclose this document or any of the enclosed information to any person other than employees of addressee to the
extent necessary for consultations with authorized personnel of Uber.
eng.uber.com
github.com/uber

More Related Content

What's hot

API Management - Why it matters!
API Management - Why it matters!API Management - Why it matters!
API Management - Why it matters!Sven Bernhardt
 
Implement API Gateway using Azure API Management
Implement API Gateway using Azure API ManagementImplement API Gateway using Azure API Management
Implement API Gateway using Azure API ManagementAlexander Laysha
 
API Management
API ManagementAPI Management
API ManagementProlifics
 
API Integration For Building Software Applications Powerpoint Presentation Sl...
API Integration For Building Software Applications Powerpoint Presentation Sl...API Integration For Building Software Applications Powerpoint Presentation Sl...
API Integration For Building Software Applications Powerpoint Presentation Sl...SlideTeam
 
Accelerate Quality with Postman - Basics
Accelerate Quality with Postman - BasicsAccelerate Quality with Postman - Basics
Accelerate Quality with Postman - BasicsKnoldus Inc.
 
API Management architect presentation
API Management architect presentationAPI Management architect presentation
API Management architect presentationsflynn073
 
Postman: An Introduction for Developers
Postman: An Introduction for DevelopersPostman: An Introduction for Developers
Postman: An Introduction for DevelopersPostman
 
Web API testing : A quick glance
Web API testing : A quick glanceWeb API testing : A quick glance
Web API testing : A quick glanceDhanalaxmi K
 
Vanrish Mulesoft Integration architect ppt
Vanrish Mulesoft Integration architect pptVanrish Mulesoft Integration architect ppt
Vanrish Mulesoft Integration architect pptRajnish Kumar
 
API Business Models
API Business ModelsAPI Business Models
API Business ModelsJohn Musser
 
The Evolution of Integration
The Evolution of IntegrationThe Evolution of Integration
The Evolution of IntegrationSoftware AG
 
B4USolution_API-Testing
B4USolution_API-TestingB4USolution_API-Testing
B4USolution_API-Testingb4usolution .
 
Modern systems architectures: Uber, Lyft, Cabify
Modern systems architectures: Uber, Lyft, CabifyModern systems architectures: Uber, Lyft, Cabify
Modern systems architectures: Uber, Lyft, CabifyAndré Faria Gomes
 
Enforcing Your Organization's API Design Standards with SwaggerHub
Enforcing Your Organization's API Design Standards with SwaggerHubEnforcing Your Organization's API Design Standards with SwaggerHub
Enforcing Your Organization's API Design Standards with SwaggerHubSmartBear
 

What's hot (20)

API Management - Why it matters!
API Management - Why it matters!API Management - Why it matters!
API Management - Why it matters!
 
How Secure Are Your APIs?
How Secure Are Your APIs?How Secure Are Your APIs?
How Secure Are Your APIs?
 
Api presentation
Api presentationApi presentation
Api presentation
 
Implement API Gateway using Azure API Management
Implement API Gateway using Azure API ManagementImplement API Gateway using Azure API Management
Implement API Gateway using Azure API Management
 
API Management
API ManagementAPI Management
API Management
 
API Integration For Building Software Applications Powerpoint Presentation Sl...
API Integration For Building Software Applications Powerpoint Presentation Sl...API Integration For Building Software Applications Powerpoint Presentation Sl...
API Integration For Building Software Applications Powerpoint Presentation Sl...
 
Accelerate Quality with Postman - Basics
Accelerate Quality with Postman - BasicsAccelerate Quality with Postman - Basics
Accelerate Quality with Postman - Basics
 
API Management architect presentation
API Management architect presentationAPI Management architect presentation
API Management architect presentation
 
Postman: An Introduction for Developers
Postman: An Introduction for DevelopersPostman: An Introduction for Developers
Postman: An Introduction for Developers
 
Web API testing : A quick glance
Web API testing : A quick glanceWeb API testing : A quick glance
Web API testing : A quick glance
 
Vanrish Mulesoft Integration architect ppt
Vanrish Mulesoft Integration architect pptVanrish Mulesoft Integration architect ppt
Vanrish Mulesoft Integration architect ppt
 
API Business Models
API Business ModelsAPI Business Models
API Business Models
 
The Evolution of Integration
The Evolution of IntegrationThe Evolution of Integration
The Evolution of Integration
 
B4USolution_API-Testing
B4USolution_API-TestingB4USolution_API-Testing
B4USolution_API-Testing
 
API Presentation
API PresentationAPI Presentation
API Presentation
 
Ola cabs
Ola cabsOla cabs
Ola cabs
 
Cab booking app
Cab booking appCab booking app
Cab booking app
 
Modern systems architectures: Uber, Lyft, Cabify
Modern systems architectures: Uber, Lyft, CabifyModern systems architectures: Uber, Lyft, Cabify
Modern systems architectures: Uber, Lyft, Cabify
 
Enforcing Your Organization's API Design Standards with SwaggerHub
Enforcing Your Organization's API Design Standards with SwaggerHubEnforcing Your Organization's API Design Standards with SwaggerHub
Enforcing Your Organization's API Design Standards with SwaggerHub
 
Effective API Design
Effective API DesignEffective API Design
Effective API Design
 

Viewers also liked

Just Add Reality: Managing Logistics with the Uber Developer Platform
Just Add Reality: Managing Logistics with the Uber Developer PlatformJust Add Reality: Managing Logistics with the Uber Developer Platform
Just Add Reality: Managing Logistics with the Uber Developer PlatformApigee | Google Cloud
 
"Building Data Foundations and Analytics Tools Across The Product" by Crystal...
"Building Data Foundations and Analytics Tools Across The Product" by Crystal..."Building Data Foundations and Analytics Tools Across The Product" by Crystal...
"Building Data Foundations and Analytics Tools Across The Product" by Crystal...Tech in Asia ID
 
Taxi Startup Presentation for Taxi Company
Taxi Startup Presentation for Taxi CompanyTaxi Startup Presentation for Taxi Company
Taxi Startup Presentation for Taxi CompanyEugene Suslo
 
Open-source Infrastructure at Lyft
Open-source Infrastructure at LyftOpen-source Infrastructure at Lyft
Open-source Infrastructure at LyftDaniel Hochman
 
Building Real-Time Applications with Android and WebSockets
Building Real-Time Applications with Android and WebSocketsBuilding Real-Time Applications with Android and WebSockets
Building Real-Time Applications with Android and WebSocketsSergi Almar i Graupera
 
Geospatial Indexing at Scale: The 15 Million QPS Redis Architecture Powering ...
Geospatial Indexing at Scale: The 15 Million QPS Redis Architecture Powering ...Geospatial Indexing at Scale: The 15 Million QPS Redis Architecture Powering ...
Geospatial Indexing at Scale: The 15 Million QPS Redis Architecture Powering ...Daniel Hochman
 
Kafka + Uber- The World’s Realtime Transit Infrastructure, Aaron Schildkrout
Kafka + Uber- The World’s Realtime Transit Infrastructure, Aaron SchildkroutKafka + Uber- The World’s Realtime Transit Infrastructure, Aaron Schildkrout
Kafka + Uber- The World’s Realtime Transit Infrastructure, Aaron Schildkroutconfluent
 
Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...
Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...
Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...DataStax
 

Viewers also liked (9)

Just Add Reality: Managing Logistics with the Uber Developer Platform
Just Add Reality: Managing Logistics with the Uber Developer PlatformJust Add Reality: Managing Logistics with the Uber Developer Platform
Just Add Reality: Managing Logistics with the Uber Developer Platform
 
"Building Data Foundations and Analytics Tools Across The Product" by Crystal...
"Building Data Foundations and Analytics Tools Across The Product" by Crystal..."Building Data Foundations and Analytics Tools Across The Product" by Crystal...
"Building Data Foundations and Analytics Tools Across The Product" by Crystal...
 
Taxi Startup Presentation for Taxi Company
Taxi Startup Presentation for Taxi CompanyTaxi Startup Presentation for Taxi Company
Taxi Startup Presentation for Taxi Company
 
Open-source Infrastructure at Lyft
Open-source Infrastructure at LyftOpen-source Infrastructure at Lyft
Open-source Infrastructure at Lyft
 
Building Real-Time Applications with Android and WebSockets
Building Real-Time Applications with Android and WebSocketsBuilding Real-Time Applications with Android and WebSockets
Building Real-Time Applications with Android and WebSockets
 
Geospatial Indexing at Scale: The 15 Million QPS Redis Architecture Powering ...
Geospatial Indexing at Scale: The 15 Million QPS Redis Architecture Powering ...Geospatial Indexing at Scale: The 15 Million QPS Redis Architecture Powering ...
Geospatial Indexing at Scale: The 15 Million QPS Redis Architecture Powering ...
 
Kafka + Uber- The World’s Realtime Transit Infrastructure, Aaron Schildkrout
Kafka + Uber- The World’s Realtime Transit Infrastructure, Aaron SchildkroutKafka + Uber- The World’s Realtime Transit Infrastructure, Aaron Schildkrout
Kafka + Uber- The World’s Realtime Transit Infrastructure, Aaron Schildkrout
 
31 - IDNOG03 - Bergas Bimo Branarto (GOJEK) - Scaling Gojek
31 - IDNOG03 - Bergas Bimo Branarto (GOJEK) - Scaling Gojek31 - IDNOG03 - Bergas Bimo Branarto (GOJEK) - Scaling Gojek
31 - IDNOG03 - Bergas Bimo Branarto (GOJEK) - Scaling Gojek
 
Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...
Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...
Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...
 

Similar to Uber's New Mobile Architecture Enables Modularity and Experimentation

Mobile Architecture at Scale
Mobile Architecture at ScaleMobile Architecture at Scale
Mobile Architecture at ScaleGergely Orosz
 
Overview of azure microservices and the impact on integration
Overview of azure microservices and the impact on integrationOverview of azure microservices and the impact on integration
Overview of azure microservices and the impact on integrationBizTalk360
 
Dynamic APIs: SOA Done Right
Dynamic APIs: SOA Done RightDynamic APIs: SOA Done Right
Dynamic APIs: SOA Done RightInside Analysis
 
Service Oriented Architecture
Service Oriented Architecture Service Oriented Architecture
Service Oriented Architecture Prabhat gangwar
 
5 Years Of Building SaaS On AWS
5 Years Of Building SaaS On AWS5 Years Of Building SaaS On AWS
5 Years Of Building SaaS On AWSChristian Beedgen
 
Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?Apigee | Google Cloud
 
Architecting Microservices in .Net
Architecting Microservices in .NetArchitecting Microservices in .Net
Architecting Microservices in .NetRichard Banks
 
Delivering New Digital Experiences Fast - Introducing Choreo
Delivering New Digital Experiences Fast - Introducing ChoreoDelivering New Digital Experiences Fast - Introducing Choreo
Delivering New Digital Experiences Fast - Introducing ChoreoWSO2
 
Angular from Zero to Mastery - Training (Intermediate)
Angular from Zero to Mastery - Training (Intermediate)Angular from Zero to Mastery - Training (Intermediate)
Angular from Zero to Mastery - Training (Intermediate)Smail LOUNES
 
Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019
Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019
Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019Haufe-Lexware GmbH & Co KG
 
Toronto node js_meetup
Toronto node js_meetupToronto node js_meetup
Toronto node js_meetupShubhra Kar
 
Your API is your Product - Arun Ravindran, Unisys
Your API is your Product - Arun Ravindran, UnisysYour API is your Product - Arun Ravindran, Unisys
Your API is your Product - Arun Ravindran, Unisysbaconfblr
 
Going Mobile at a Glance - Do you need to build from scratch?
Going Mobile at a Glance - Do you need to build from scratch?Going Mobile at a Glance - Do you need to build from scratch?
Going Mobile at a Glance - Do you need to build from scratch?Cronos Mobile
 
DevOps on AWS: Accelerating Software Delivery with AWS Developer Tools | AWS ...
DevOps on AWS: Accelerating Software Delivery with AWS Developer Tools | AWS ...DevOps on AWS: Accelerating Software Delivery with AWS Developer Tools | AWS ...
DevOps on AWS: Accelerating Software Delivery with AWS Developer Tools | AWS ...Amazon Web Services
 
#1922 rest-push2 ap-im-v6
#1922 rest-push2 ap-im-v6#1922 rest-push2 ap-im-v6
#1922 rest-push2 ap-im-v6Jack Carnes
 
The elegant way of implementing microservices with istio
The elegant way of implementing microservices with istioThe elegant way of implementing microservices with istio
The elegant way of implementing microservices with istioInho Kang
 
12월 16일 Meetup [Deep Dive] Microservice 트래픽 관리를 위한 Istio 알아보기 | 강인호 컨설턴트, 오라클
12월 16일 Meetup [Deep Dive] Microservice 트래픽 관리를 위한 Istio 알아보기 | 강인호 컨설턴트, 오라클12월 16일 Meetup [Deep Dive] Microservice 트래픽 관리를 위한 Istio 알아보기 | 강인호 컨설턴트, 오라클
12월 16일 Meetup [Deep Dive] Microservice 트래픽 관리를 위한 Istio 알아보기 | 강인호 컨설턴트, 오라클Oracle Korea
 
Microservices
MicroservicesMicroservices
MicroservicesSmartBear
 

Similar to Uber's New Mobile Architecture Enables Modularity and Experimentation (20)

Twelve factor-app
Twelve factor-appTwelve factor-app
Twelve factor-app
 
Mobile Architecture at Scale
Mobile Architecture at ScaleMobile Architecture at Scale
Mobile Architecture at Scale
 
Overview of azure microservices and the impact on integration
Overview of azure microservices and the impact on integrationOverview of azure microservices and the impact on integration
Overview of azure microservices and the impact on integration
 
Dynamic APIs: SOA Done Right
Dynamic APIs: SOA Done RightDynamic APIs: SOA Done Right
Dynamic APIs: SOA Done Right
 
Service Oriented Architecture
Service Oriented Architecture Service Oriented Architecture
Service Oriented Architecture
 
5 Years Of Building SaaS On AWS
5 Years Of Building SaaS On AWS5 Years Of Building SaaS On AWS
5 Years Of Building SaaS On AWS
 
Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?
 
Architecting Microservices in .Net
Architecting Microservices in .NetArchitecting Microservices in .Net
Architecting Microservices in .Net
 
Api design part 1
Api design part 1Api design part 1
Api design part 1
 
Delivering New Digital Experiences Fast - Introducing Choreo
Delivering New Digital Experiences Fast - Introducing ChoreoDelivering New Digital Experiences Fast - Introducing Choreo
Delivering New Digital Experiences Fast - Introducing Choreo
 
Angular from Zero to Mastery - Training (Intermediate)
Angular from Zero to Mastery - Training (Intermediate)Angular from Zero to Mastery - Training (Intermediate)
Angular from Zero to Mastery - Training (Intermediate)
 
Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019
Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019
Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019
 
Toronto node js_meetup
Toronto node js_meetupToronto node js_meetup
Toronto node js_meetup
 
Your API is your Product - Arun Ravindran, Unisys
Your API is your Product - Arun Ravindran, UnisysYour API is your Product - Arun Ravindran, Unisys
Your API is your Product - Arun Ravindran, Unisys
 
Going Mobile at a Glance - Do you need to build from scratch?
Going Mobile at a Glance - Do you need to build from scratch?Going Mobile at a Glance - Do you need to build from scratch?
Going Mobile at a Glance - Do you need to build from scratch?
 
DevOps on AWS: Accelerating Software Delivery with AWS Developer Tools | AWS ...
DevOps on AWS: Accelerating Software Delivery with AWS Developer Tools | AWS ...DevOps on AWS: Accelerating Software Delivery with AWS Developer Tools | AWS ...
DevOps on AWS: Accelerating Software Delivery with AWS Developer Tools | AWS ...
 
#1922 rest-push2 ap-im-v6
#1922 rest-push2 ap-im-v6#1922 rest-push2 ap-im-v6
#1922 rest-push2 ap-im-v6
 
The elegant way of implementing microservices with istio
The elegant way of implementing microservices with istioThe elegant way of implementing microservices with istio
The elegant way of implementing microservices with istio
 
12월 16일 Meetup [Deep Dive] Microservice 트래픽 관리를 위한 Istio 알아보기 | 강인호 컨설턴트, 오라클
12월 16일 Meetup [Deep Dive] Microservice 트래픽 관리를 위한 Istio 알아보기 | 강인호 컨설턴트, 오라클12월 16일 Meetup [Deep Dive] Microservice 트래픽 관리를 위한 Istio 알아보기 | 강인호 컨설턴트, 오라클
12월 16일 Meetup [Deep Dive] Microservice 트래픽 관리를 위한 Istio 알아보기 | 강인호 컨설턴트, 오라클
 
Microservices
MicroservicesMicroservices
Microservices
 

Recently uploaded

Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 

Recently uploaded (20)

Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 

Uber's New Mobile Architecture Enables Modularity and Experimentation

  • 1. Uber’s New Mobile Architecture Uber Mobility April 19th, 2017
  • 2. Why a new architecture? Tuomas Artman
  • 3. Uber’s entire mobile team 4 ½ years ago
  • 4.
  • 5.
  • 6. “What if we changed everything?”
  • 7. 99.99% availability of core flows Enable global roll-back of core flows to a guaranteed working state Testing as a first-class citizen Architectural goals
  • 8. 99.99% availability of core flows Enable global roll-back of core flows to a guaranteed working state Testing as a first-class citizen Support Uber’s growth for years to come Narrow and decouple functionality as much as possible Architectural goals
  • 9. 99.99% availability of core flows Enable global roll-back of core flows to a guaranteed working state Testing as a first-class citizen Support Uber’s growth for years to come Narrow and decouple functionality as much as possible Provide rails for both design and code Consistency in engineering, consistency in UX Architectural goals
  • 10. 99.99% availability of core flows Enable global roll-back of core flows to a guaranteed working state Testing as a first-class citizen Support Uber’s growth for years to come Narrow and decouple functionality as much as possible Provide rails for both design and code Consistency in engineering, consistency in UX Monitoring is a first-class citizen Automatic analytics, logging, debugging, and tracing Architectural goals
  • 11. 99.99% availability of core flows Enable global roll-back of core flows to a guaranteed working state Testing as a first-class citizen Support Uber’s growth for years to come Narrow and decouple functionality as much as possible Provide rails for both design and code Consistency in engineering, consistency in UX Monitoring is a first-class citizen Automatic analytics, logging, debugging, and tracing De-risk experimentation Application framework with Plugin API Architectural goals
  • 12. 99.99% availability of core flows Enable global roll-back of core flows to a guaranteed working state Testing as a first-class citizen Support Uber’s growth for years to come Narrow and decouple functionality as much as possible Provide rails for both design and code Consistency in engineering, consistency in UX Monitoring is a first-class citizen Automatic analytics, logging, debugging, and tracing De-risk experimentation Application framework with Plugin API Make magic Performance second to none, graceful degradation on low-end devices and networks Architectural goals
  • 13. Copyright Tsahi Levent-Levi Multiplatform architecture Double the effectiveness of teams
  • 15. RIB Architecture Application Framework Dependency management Reactive data flows Scoping Compartmentalization Analytics UI Components Mapping Testability Experimentation Plugins Threading model Storage Location services Logging Monitoring Networking Routing Code gen Business-logic driven Open source
  • 17. Dealing with State Lots of apps have tricky asynchronous, state issues At Uber, this compounds quite a bit Uber’s apps have a lot of asynchronous state, from multiple data sources 150+ contributors
  • 18. Scopes? “The lifecycle in which an object exists.”
  • 20. RiderAppDelegate / RiderApplication { PickupRequestManager DestinationRefinementStream DriverLocationMapLayer … and a lot more stuff… }
  • 21. What’s so bad about this?
  • 22. Stability and Code Quality Impact Objects that live longer than necessary are exposed to more state they don’t need. In Uber’s apps in particular, many of these stateful objects observe different streams of data. This means these objects might get frequent updates even when they aren’t being used. class DriverIsOnTheirWayToaster { private boolean isOnTripAndHasNotBeenNotified; public DriverIsOnTheirWayToaster(TripStateStream tripStateStream) { tripStateStream.subscribe({ (state, driver?) -> if (state == ON_THEIR_WAY { isOnTripAndHasNotBeenNotified = true; showToast(driver!.name); } else if (state == OFF_TRIP) { isOnTripAndHasNotBeenNotified = false; } }) } }
  • 23. Input and dependency contracts are diluted When objects live at app scope, they cannot have very rigid inputs and dependencies. Why does this class take an optional AuthToken if it’s really required? How does this hurt testing? public class AuthenticatedNetworkRequester { private AuthToken? authToken; public void makeRequest() { networkClient.makeRequest(authToken!) } }
  • 24. Other Issues While most of the classes are very simple, having lots of objects around for the entire duration of the app’s lifecycle is not super efficient. Classes can grow to not have a clear purpose. Although it wasn’t as bad as some of the examples, there was no standard way to “scope” singletons and objects to different lifecycles of the app.
  • 25. Previous Rider App Scope Hierarchy
  • 26. How do we improve this?
  • 27. Improvements Lots of our bugs are state related. A pattern or framework to encourage creating objects only when relevant would help here. The view hierarchy doesn’t really line up with business logic. We should create a hierarchy based on business logic states, which does not necessarily map to what is on the screen. There was no easy, consistent way to create your own scopes.
  • 29. Scopes Root doesn’t know anything - it can’t make any assumptions. Root
  • 30. Scopes LoggedIn knows that you have valid non-null authentication credentials. Dependencies created and provided here can take non-null credentials without having to make any assumptions. Root LoggedIn
  • 31. Moving AuthenticatedNetworkRequester to LoggedIn Scope public class AuthenticatedNetworkRequester { private AuthToken? authToken; public void makeRequest() { networkClient.makeRequest(authToken!) } }
  • 32. Moving AuthenticatedNetworkRequester to LoggedIn Scope AuthToken is now guaranteed to be available. Other objects that depend on AuthenticatedNetworkRequester need to be in a logged in state to use it. If a dependency requires AuthenticatedNetworkRequester outside of the LoggedIn scope, it’s now a compile error. public class AuthenticatedNetworkRequester { private AuthToken authToken; public void makeRequest() { networkClient.makeRequest(authToken) } }
  • 33. Scopes OnTrip knows that the user is logged in and on a trip. Dependencies created and provided here can take non-null credentials and all data related to a trip without having to make any assumptions. Root LoggedIn OnTrip
  • 34. Moving DriverIsOnTheirWayToaster to OnTrip Scope class DriverIsOnTheirWayToaster { private boolean isOnTripAndHasNotBeenNotified; public DriverIsOnTheirWayToaster(TripStateStream tripStateStream) { tripStateStream.subscribe({ (state, driver?) -> if (state == ON_THEIR_WAY { isOnTripAndHasNotBeenNotified = true; showToast(driver!.name); } else if (state == OFF_TRIP) { isOnTripAndHasNotBeenNotified = false; } }) } }
  • 35. Moving DrvierIsOnTheirWayToaster to OnTrip Scope Now DrvierIsOnTheirWayToaster is exposed to much less state - it’s easier to understand, and less prone to bugs. class DriverIsOnTheirWayToaster { public DriverIsOnTheirWayToaster(Driver driver) { showToast(driver.name); } }
  • 36.
  • 44. RIB Tree & Inter-RIB Communication Composing RIBs into features
  • 45. RIB Tree & Inter-RIB Communication Composing RIBs into features
  • 46. RIB Tree & Inter-RIB Communication Composing RIBs into features
  • 47. RIB Tree & Inter-RIB Communication Composing RIBs into features
  • 48. RIB Tree & Inter-RIB Communication Composing RIBs into features
  • 50. What about other architectures? MVC ● Massive ViewController ● Locked in view tree and business tree MVVM ● Massive ViewModel ● Locked in view tree and business tree VIPER ● Logic separation based on view ● Locked in view tree and business tree
  • 51. What did RIBs give us? ● Rider app broken up into more than 500 RIBs ○ Many are reused with multiple parts of the tree ● All RIBs have less than 300 lines of code per class ● All business logic well unit-tested
  • 53. ● Support Uber’s growth for years to come? ● Provide rails for both design and code ● De-risk experimentation Architectural goals Consider three of our architectural goals:
  • 54. Support Uber’s growth for years to come RIBs give us code isolation We want more code isolation
  • 60. Support Uber’s growth for years to come Provide rails for both design and code? De-risk experimentation How do Plugins play into Architectural goals? Consider three of our architectural goals:
  • 62. Interface: Router<? extends MapComponent> { } Example: NearbyVehiclesMapLayer PresentLocationMapLayer CurbsidePickupMapLayer DestinationRefinementMapLayer Home Screen
  • 63. for (HomeMapLayerPlugin plugin: plugins) { attachChild(plugin.buildRib(component)); } Home Screen
  • 65. Interface: interface LocationRowProvider { Observable<SearchResult[]> query(input); } interface SearchResult { String tag(); Router buildRouter(parent); } Example: CalendarResultsPlugin SavedLocationsPlugin GeoSearchResultsPlugin FriendsLocationPlugin
  • 67. @Override protected void didBecomeActive() { for (Work worker : mainScopedPluginManager.get()) { work.start(); } } Viewless plugins
  • 68. Interface: interface MenuPlugin { MenuCategory menuCategory(); Router buildRouter(MenuPluginComponent) } enum MenuCategory { TOP, BOTTOM } Example: PaymentMenuPlugin FreeRidesPlugin HelpPlugin
  • 69. Almost all features in the app can be written as code that plugs into the core of the app.
  • 70. 80% of Rider’s Application Layer written as Plugins
  • 71. New plugin points and changes to core get extra code reviewers added automatically.
  • 72. Support Uber’s growth for years to come Provide rails for both design and code De-risk experimentation? How do Plugins play into Architectural goals? Consider three of our architectural goals:
  • 73. Derisking Experimentation Roll out all new features as plugins Every plugin is initially A/B tested Every plugin can be disabled from our servers UI tests ensure the app is still functional when all plugins disabled
  • 75. Engineers want to reuse existing plugin points and now know where the build new features We’ve prevented six outages in production by disabling plugins Statically ensured code isolation between the architecturally significant core of the app and the app’s features Results From using plugins
  • 76. Development Velocity Able to sustain 500 diffs/week per platform Diffs landed per week doubled after finishing the four month rewrite Crash Free Rate Immediately after releasing the new app, crash rate was better than the old app iOS crash free free rate of 99.99% and climbing Android crash free rate of 99.9% and climbing Performance App starts 50% faster Developer Happiness 78.5 developer NPS score improvement Results From the new architecture
  • 77. Thank you Proprietary and confidential © 2016 Uber Technologies, Inc. All rights reserved. No part of this document may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval systems, without permission in writing from Uber. This document is intended only for the use of the individual or entity to whom it is addressed and contains information that is privileged, confidential or otherwise exempt from disclosure under applicable law. All recipients of this document are notified that the information contained herein includes proprietary and confidential information of Uber, and recipient may not make use of, disseminate, or in any way disclose this document or any of the enclosed information to any person other than employees of addressee to the extent necessary for consultations with authorized personnel of Uber. eng.uber.com github.com/uber

Editor's Notes

  1. Welcome Anyone new here? What Uber mobility is about Today a special meetup ->
  2. Intro Tuomas, Tony, Yi and Brian Gonna talk about why and how we came to build a new architecture, Jump into scopes, what they are in order to understand the architecture Then we’re talking about RIB’s our new architecture Finally, we’re looking at how we’re using plugins in our new architecture
  3. 4 ½ years ago in Tahoe, the entire team. Times were different Today we have almost 400 mobile engineers
  4. 4 ½ years ago this is what they build. The team laid the foundation, used MVC and was just hands down shipping feature after feature Once our team started groing, the architecture came in our way Testing everyones functionality Regressions, weird error cases due to shared view controllers Ownership problems Main controller was 6000 lines of code So we started refactoring, with some success ->
  5. Then the UX started breaking down, too Teams would add horizontal views everywhere Product slider became super populated. After careful consideration ->
  6. We put some serious thought into this With architectural problems AND design wanting to fully redesign the app we started a rewrite So what do you do when you start from the basics?
  7. You come up with architectural goals
  8. Once we had the goals which obviously applied to both of our platforms, we thought what if we decied to use the same concept on both iOS and Android as closely as possible Same class names, same functionality, same libraries, wherever possible Essentially doubling your team when designing Design once, write twice Feature teams got a huge productivity boost out of this
  9. So this is what we designed and implemented
  10. Earlier on Tuomas mentioned we had six goals during our architectural development phase. RIBs help with several of these. RIBs don’t get 100% of the way there. So let’s focus on the first architectural goal. Discuss additional ideas for how to achieve it. And then explain how similar ideas get us the other goal.
  11. Support Uber’s growth for years to come About code isolation So large number of engineers can work independently in the same app as we become an even bigger company So code becomes more reusable
  12. Let’s talk about code isolation between RIBs. Let’s consider the Request Confirmation Steps, for example. After making a pickup request you are shown a series of blocking steps depending on your current context, like whether you’re at an airport.
  13. Each one of these RIBs is farely independent. But what about coupling between parent and child ...
  14. Each one of these RIBs is farely independent. But what about coupling between parent and child ...
  15. Old notes: need to update One way to address this is with dependency inversion. [Show dependency inversion]. Move the PickupRefinement controller into its own library with the following structure. If you have a mono-repo this isn’t too much work. But it is harder to read code. And it does force the parent of Refinement Steps to know about Refinement Step’s implementation details. Given the Rider app has a 100 different places where orchistration patterns like this occur, it doesn’t make sense to use dependency inversion in all these places
  16. We start thinking about plugin mechanisms. And we settle on one that still allows you to structure your application in a natural way, but with strict seperation between the plugin consumer and the plugin child by using static analysis on Android and framework dependency restrictions on iOS. The Refinement Steps just consumes Refinement Step interfaces and can’t possibly be coupled to any of the children refinement step classes.
  17. We have this simple plugin idea: A plugin mechanism that can return plugins of some predefined type to a consumer with code isolation. This gives us more code isolation. But what else does it give us? If all it gave us was code isolation I wouldn’t be spending 20 minutes talking abou it. How can we use it to provide product and code rails?
  18. LocationEditor button plugin used by scheduled rides Every feed item is a plugin The location shortcuts are plugins The map layers are plugins The button in the top right is a plugin
  19. TODO: show the code that consumes this
  20. TODO: show the code that consumes this
  21. LocationEditor button plugin used by scheduled rides Every feed item is a plugin The location shortcuts are plugins The map layers are plugins The button in the top right is a plugin
  22. Sometimes plugins don’t need to be routers.
  23. Can be used as a way of building extension points of arbitary types in the app.
  24. Explain how these text entries are actually just represented as RIBs. They could definately be represented as Pair<ClickListener, Text> but we wanted to offer more flexibility. Probably about 75% of all plugin make sense to be represented as RIBs. TODO: add a GIF on the next screen of clicking on the GiftCard plugin.
  25. Basically only the scaffolding, glue logic and base libraries are inside core
  26. Core: Basically only the scaffolding, glue logic and base libraries are inside core. This coordinates the different plugin points in the app. Because modifications to “Core” are architecturally significant, this code is reviewed extra thoroughly. To avoid this, engineers want to reuse the existing plugin points that have already been rigorously considered by UX. Ideas to express: Not every plugin is a RIB
  27. Basically only the scaffolding, glue logic and base libraries are inside core
  28. Realized that introducing a new plugin was a particularly non-risky way to experiment with adding a new feature. If we wanted to disable the feature we can be 100% confident that doing this won’t systemically break the app because the core of the app doesn’t depend on the existence of any one plugin.
  29. We would never turn off all these plugins of course. Plugins are designed to be isolated enough that we should never get in a situation where we need to disable all of them.
  30. Realized that introducing a new plugin was a particularly non-risky way to experiment with adding a new feature. If we wanted to disable the feature we can be 100% confident that doing this won’t systemically break the app because the core of the app doesn’t depend on the existence of any one plugin.
  31. Joel Spoelsky Development velocity Able to sustain 500 diffs/week per platform Diffs landed per week doubled after finishing the four month rewrite This number is backed by engineer testimony that say they need to spend less time hunting around the code base to figure out how to write features now Performance: Code isolation and consistent patterns naturally lead to