Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Mobile at Scale: from startup to a big company - Dor Samet, Booking.com
1. Mobile at Scale
Dor Samet | 19.12.2019
Lessons from taking a startup approach at a big company
2. ● Developer for 6+ years
● Co-founder of the KotlinTLV
community
● Scotch enthusiast
● Android Developer at Booking.com
Machine Learning site
Quick Introduction
Dor Samet
7. 1996
Founded in
Amsterdam
in 220+
countries
& territories
29+ million
listings
including
6+ million
listing in homes,
apartments and other
unique places to stay.
43
supported
languages
24/7
customer
service
200+offices
in over
70countries
17,500+
dedicated
employees
1,550,000
room nights
booked
every 24 hours
187
million+
verified
guest reviews
online
17,500+
affiliate partners
145+ million
destination
recommendations
Company
highlights.
30
different
property
types
2005
Became a part of
Booking Holdings
Inc. (then Priceline
Group)
15. Build time
> 260K methods
Cold start (after clean): ~14 minutes
Incremental build (changes in a few modules up the chain): ~ 3
minutes
Incremental build (changes in one modules): ~700 milliseconds
16. ● Module scopes a certain entity in
the app
● Prepare for the future (instant apps,
fast iterations)
● Makes your gradle build FAST
● Gradle caches what is already built
Why modularization?
17. Layers - Grouping of module
Current structure:
Presentation
screens
UI Components
AppServices
data, models, etc.
CoreServices
monitoring, localization, network, icons, experiment management, etc.
18. ● Place org.gradle.caching=true
In your gradle.properties file*
● Create a new module
● Develop in the new module
● Include like another dependency
(gradle)
○ implementation
project(path:`yourModuleName`)
How modularization?
19. ● Module scopes a certain entity in
the app
● Prepare for the future (instant apps,
fast iterations)
● Makes your gradle build FAST
● Scale through fast iterations, and
decoupled logic
Why modularization?
21. ● Avoid common bugs through
known patterns
○ Syntactically correct code - but isn’t
● Code reviews
○ Only occur once the checks and tests
allow
● Run on CI
○ Asynchronous testing
● Synchronize teams to standards
○ Teams in London, Shanghai, Amsterdam
and Tel Aviv
Why Automatic Checks?
22. How Automatic Checks?
● Static Analysis tools
○ e.g. Lint
○ Avoid common bugs
○ Push to use company tools
○ Run on CI for asynchronicity
○ Super easy to implement:
47. class AsyncTaskStaticReferenceCheck : Detector(), Detector.UastScanner {
companion object Issues {
@JvmField
val asyncTaskStaticReference = Issue.create(
"async-task-static-reference",
" `AsyncTask` in a `static` context might leak memory",
"""`AsyncTask` usually have a reference to one or more `Context` instances
|(e.g. `Activity`) which might leak if a reference is held without a lifecycle.""".trimMargin(),
Category.CORRECTNESS,
5,
Severity.ERROR,
Implementation(AsyncTaskStaticReferenceCheck::class.java, Scope.JAVA_FILE_SCOPE)
)
}
// ..
// ..
}
48. class AsyncTaskStaticReferenceCheck : Detector(), Detector.UastScanner {
companion object Issues {
@JvmField
val asyncTaskStaticReference = Issue.create(
"async-task-static-reference",
" `AsyncTask` in a `static` context might leak memory",
"""`AsyncTask` usually have a reference to one or more `Context` instances
|(e.g. `Activity`) which might leak if a reference is held without a lifecycle.""".trimMargin(),
Category.CORRECTNESS,
5,
Severity.ERROR,
Implementation(AsyncTaskStaticReferenceCheck::class.java, Scope.JAVA_FILE_SCOPE)
)
}
// ..
// ..
}
Wait a minute…
60. Typical approaches to hypotheses
I have a feeling that placing our app in the
Amazon store is a good idea.
Our CEO wants us to work on a chatbot for
better engagement.
Based on what I saw in our analytics, our
users tend to be younger, so we should
put our app on ads in Instagram.
61. Build
Create a thing that answers a
hypothesis
Measure
Does it answer my original hypothesis?
Is my target audience correctly
organized?
Learn
Was my hypothesis answered? How can
I improve upon it?
Experimentation
definition
Build
M
easure
Learn
62. Hypothesis + Success
metrics
I have a feeling that placing our app in the
Amazon store is a good idea. We will
increase user acquisition by at least 10%.
We’ll learn if it’s a good idea.
Our CEO wants us to work on a chatbot for
better engagement. User retention
increased by at least a week. Let’s see if
that’s a good use of our time.
Based on what I saw in our analytics, our
users tend to be younger, so we should
put our app on ads in Instagram.
Segmented audience increased by at least
23%. We’ll see if young users like the app.
Build
Create a thing that answers a
hypothesis
Measure
Does it answer my original hypothesis?
Is my target audience correctly
organized?
Learn
Was my hypothesis answered? How can
I improve upon it?