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

Microservices: The Right Way
Microservices: The Right WayMicroservices: The Right Way
Microservices: The Right WayDaniel Woods
 
Comparison of Current Service Mesh Architectures
Comparison of Current Service Mesh ArchitecturesComparison of Current Service Mesh Architectures
Comparison of Current Service Mesh ArchitecturesMirantis
 
We Built This City - Apigee Edge Architecture
We Built This City - Apigee Edge ArchitectureWe Built This City - Apigee Edge Architecture
We Built This City - Apigee Edge ArchitectureApigee | Google Cloud
 
React Components Lifecycle | React Tutorial for Beginners | ReactJS Training ...
React Components Lifecycle | React Tutorial for Beginners | ReactJS Training ...React Components Lifecycle | React Tutorial for Beginners | ReactJS Training ...
React Components Lifecycle | React Tutorial for Beginners | ReactJS Training ...Edureka!
 
REST API Design & Development
REST API Design & DevelopmentREST API Design & Development
REST API Design & DevelopmentAshok Pundit
 
Bringing API Management to AWS Powered Backends
Bringing API Management to AWS Powered BackendsBringing API Management to AWS Powered Backends
Bringing API Management to AWS Powered BackendsApigee | Google Cloud
 
Monitoring in Azure
Monitoring in AzureMonitoring in Azure
Monitoring in AzureTorben Knerr
 
Introduction to AWS Secrets Manager
Introduction to AWS Secrets ManagerIntroduction to AWS Secrets Manager
Introduction to AWS Secrets ManagerAmazon Web Services
 
Cloud agnostic - an approach you might want to avoid
Cloud agnostic - an approach you might want to avoidCloud agnostic - an approach you might want to avoid
Cloud agnostic - an approach you might want to avoidJelizaveta Sudakova
 
Web worker in your angular application
Web worker in your angular applicationWeb worker in your angular application
Web worker in your angular applicationSuresh Patidar
 
Device Twins, Digital Twins and Device Shadow
Device Twins, Digital Twins and Device ShadowDevice Twins, Digital Twins and Device Shadow
Device Twins, Digital Twins and Device ShadowEstelle Auberix
 
Service Worker Presentation
Service Worker PresentationService Worker Presentation
Service Worker PresentationKyle Dorman
 
Understanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootUnderstanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootKashif Ali Siddiqui
 

What's hot (20)

Microservices: The Right Way
Microservices: The Right WayMicroservices: The Right Way
Microservices: The Right Way
 
Comparison of Current Service Mesh Architectures
Comparison of Current Service Mesh ArchitecturesComparison of Current Service Mesh Architectures
Comparison of Current Service Mesh Architectures
 
We Built This City - Apigee Edge Architecture
We Built This City - Apigee Edge ArchitectureWe Built This City - Apigee Edge Architecture
We Built This City - Apigee Edge Architecture
 
How Secure Are Your APIs?
How Secure Are Your APIs?How Secure Are Your APIs?
How Secure Are Your APIs?
 
React Components Lifecycle | React Tutorial for Beginners | ReactJS Training ...
React Components Lifecycle | React Tutorial for Beginners | ReactJS Training ...React Components Lifecycle | React Tutorial for Beginners | ReactJS Training ...
React Components Lifecycle | React Tutorial for Beginners | ReactJS Training ...
 
REST API Design & Development
REST API Design & DevelopmentREST API Design & Development
REST API Design & Development
 
API Governance in the Enterprise
API Governance in the EnterpriseAPI Governance in the Enterprise
API Governance in the Enterprise
 
Bringing API Management to AWS Powered Backends
Bringing API Management to AWS Powered BackendsBringing API Management to AWS Powered Backends
Bringing API Management to AWS Powered Backends
 
Apigee Edge Overview and Roadmap
Apigee Edge Overview and RoadmapApigee Edge Overview and Roadmap
Apigee Edge Overview and Roadmap
 
Monitoring in Azure
Monitoring in AzureMonitoring in Azure
Monitoring in Azure
 
Istio a service mesh
Istio   a service meshIstio   a service mesh
Istio a service mesh
 
Introduction to AWS Secrets Manager
Introduction to AWS Secrets ManagerIntroduction to AWS Secrets Manager
Introduction to AWS Secrets Manager
 
Gravitee.io
Gravitee.ioGravitee.io
Gravitee.io
 
Cloud agnostic - an approach you might want to avoid
Cloud agnostic - an approach you might want to avoidCloud agnostic - an approach you might want to avoid
Cloud agnostic - an approach you might want to avoid
 
Web worker in your angular application
Web worker in your angular applicationWeb worker in your angular application
Web worker in your angular application
 
Device Twins, Digital Twins and Device Shadow
Device Twins, Digital Twins and Device ShadowDevice Twins, Digital Twins and Device Shadow
Device Twins, Digital Twins and Device Shadow
 
Rent a car
Rent a carRent a car
Rent a car
 
Service Worker Presentation
Service Worker PresentationService Worker Presentation
Service Worker Presentation
 
OAuth2 + API Security
OAuth2 + API SecurityOAuth2 + API Security
OAuth2 + API Security
 
Understanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootUnderstanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring Boot
 

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

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 (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

Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Christo Ananth
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01KreezheaRecto
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spaintimesproduction05
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdfSuman Jyoti
 

Recently uploaded (20)

Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
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
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 

Uber's new mobile architecture

  • 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