Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

6 lessons learned scaling mobile Jamie McDonald & Matej Balantič

Slide 3

Slide 3 text

175M+ monthly unique listeners ~20 mobile engineers

Slide 4

Slide 4 text

1 Product over platform

Slide 5

Slide 5 text

SoundCloud Pulse

Slide 6

Slide 6 text

Aligned experience

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

2 Find opportunities to share

Slide 9

Slide 9 text

BFFs

Slide 10

Slide 10 text

Android iOS Mobile API Skippy Skippy Through the stack

Slide 11

Slide 11 text

More ● Values ● Practices ● Knowledge

Slide 12

Slide 12 text

3 Confront technical debt

Slide 13

Slide 13 text

Brand new app Alternate approaches Modernise by vertical

Slide 14

Slide 14 text

Android ● Legacy code ● Small, incremental improvements ● Re-build vertical slices

Slide 15

Slide 15 text

Successive, well intentioned, changes to architecture throughout the lifetime of a project can lead to a fragmented and hard-to-maintain code base Lava layers

Slide 16

Slide 16 text

Rewrite by abstraction

Slide 17

Slide 17 text

Rewrite by abstraction

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

● Legacy project by an external agency ● Decision to start from scratch ● Big bang release* * except iPad which got delayed iOS

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

● Fresh start with code architecture ● Away with legacy code once and for all ● Innovation on hold for a while ● Might need to sacrifice existing features → angry users Rewrite aftermath

Slide 22

Slide 22 text

Positive side effect User complaints about iOS app crashes

Slide 23

Slide 23 text

4 Avoid premature reorganisation

Slide 24

Slide 24 text

The challenge Scaling the team

Slide 25

Slide 25 text

How we thought we’ll solve it Scaling the team

Slide 26

Slide 26 text

How it was in practice Scaling the team

Slide 27

Slide 27 text

Expectations Path to feature teams

Slide 28

Slide 28 text

Reality Path to feature teams

Slide 29

Slide 29 text

Current transitional structure Scaling the team

Slide 30

Slide 30 text

5 Empower teams

Slide 31

Slide 31 text

iOS/Android team Search Stations Sign-in Creators ... Traditional release model

Slide 32

Slide 32 text

Search Stations Sign-in Creators ... Relase train model

Slide 33

Slide 33 text

Empower teams ● Everyone can ship to master* ● Put the code behind a feature flag ● Enable the feature once ready to ship * Pairing required. When working alone you need 2x on your pull request.

Slide 34

Slide 34 text

Release train Feature development & QA Review / Public Beta Feature freeze Feature freeze Feature freeze

Slide 35

Slide 35 text

Build time configuration "release": { "inherits_from": "adhoc", "dev_always_skippy": { "enabled": false } } "release": { "inherits_from": "adhoc", "dev_always_skippy": { "enabled": true } }

Slide 36

Slide 36 text

Run time configuration

Slide 37

Slide 37 text

Behind the feature flag - (void)registerAppShortcuts { if ([FTSFlipTheSwitch isDevAppShortcutsEnabled]) { [self registerInitialActions]; } }

Slide 38

Slide 38 text

“You break it, you buy fix it” ● Continuous integration allows us to trust that we’re not breaking features ● Good unit and acceptance tests as an insurance policy

Slide 39

Slide 39 text

6 Invest in solid patterns and tools

Slide 40

Slide 40 text

Android ● Reactive programming (RxJava) ● Release pipeline ● Architecture & testability

Slide 41

Slide 41 text

LightCycle @Inject @LightCycle ActionBarUtil actionBarUtil; @Inject @LightCycle PlayerController playerController; public MainActivity() { [...] }

Slide 42

Slide 42 text

iOS ● Reactive programming (ReactiveCoca) ● Stable CoreData stack ● Dependency inversion

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

Thank you, London! soundcloud.com/jobs Jamie McDonald -- @jdamcd Matej Balantič -- @skavt

Slide 45

Slide 45 text

Mobile BFF: https://www.thoughtworks.com/insights/blog/bff-soundcloud Lava layer anti-pattern: http://mikehadlow.blogspot.de/2014/12/the-lava-layer-anti-pattern.html Branch by abstraction: http://martinfowler.com/bliki/BranchByAbstraction.html Android architecture: https://realm.io/news/gotocph-mattias-kappler-reactive-architecture-android Mobile CI @ SoundCloud: https://www.youtube.com/watch?v=Rq721qtKKNk Dependency Inversion principle: http://martinfowler.com/articles/dipInTheWild.html References