Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Working effectively at scale
Francisco Díaz
November 29, 2019
Programming
4
200
Working effectively at scale
Presented at BA:Swiftable in November, 2019.
Francisco Díaz
November 29, 2019
Tweet
Share
More Decks by Francisco Díaz
See All by Francisco Díaz
I hate public speaking. So why do I keep doing it?
fdiaz
0
42
Definiendo límites
fdiaz
1
30
Si odio hablar en público. ¿Por qué lo sigo haciendo?
fdiaz
2
59
Move fast and keep your code quality
fdiaz
1
260
De qué hablo cuando hablo de trabajo remoto
fdiaz
1
44
Setting Boundaries
fdiaz
1
54
Swift Values
fdiaz
0
36
Sisifo o Cómo empezar de nuevo - y otra vez.
fdiaz
0
45
Other Decks in Programming
See All in Programming
UI State Modeling 어떤게 좋을까?
laco2951
1
220
プログラミングを勉強したいと言われたら
yuba_4
0
390
WindowsコンテナDojo : 第1回 Visual StudioでWindowsコンテナアプリ作成
oniak3ibm
PRO
0
330
Improve Build Times in Less Time
zacsweers
6
2.8k
ebpfとWASMに思いを馳せる2022 / techfeed-conference-2022-ebpf-wasm-amsy810
masayaaoyama
0
580
WindowsコンテナDojo:第2回 Windowsコンテナアプリのビルド、公開、デプロイ
oniak3ibm
PRO
0
140
2022 FrontEnd Training
mixi_engineers
1
280
【Qiita Night】新卒エンジニアによるSwift6与太予想
eiji127
0
180
Named Document って何?
harunakano
0
370
Android入門
hn410
0
310
実録mruby組み込み体験
coe401_
0
100
バンドル最適化マニアクス at tfconf
mizchi
3
2.1k
Featured
See All Featured
Practical Orchestrator
shlominoach
178
8.6k
What's new in Ruby 2.0
geeforr
336
30k
The World Runs on Bad Software
bkeepers
PRO
56
5.2k
Product Roadmaps are Hard
iamctodd
34
6.1k
Building Applications with DynamoDB
mza
83
4.6k
GraphQLの誤解/rethinking-graphql
sonatard
24
6.2k
Code Review Best Practice
trishagee
41
6.7k
Build The Right Thing And Hit Your Dates
maggiecrowley
19
1.1k
Git: the NoSQL Database
bkeepers
PRO
415
59k
Fashionably flexible responsive web design (full day workshop)
malarkey
396
62k
4 Signs Your Business is Dying
shpigford
169
20k
Designing for humans not robots
tammielis
241
23k
Transcript
Working e!ectively at scale
Francisco Díaz franciscodiaz.cl - @fco_diaz
Startups 2011 - 2017
Airbnb 2017 - today
None
None
None
None
None
None
None
None
None
organizations ... are constrained to produce designs which are copies
of the communication structures of these organizations — Conway's law
How do you divide your codebase?
Architectural layer
User Flow
What about Airbnb?
None
1 million lines of Swift
~80 commits to master on any given day to the
repo (Android + iOS)
Bigger buckets
None
A user should be able to wishlist a listing from
the booking flow
How do they relate with each other?
None
None
None
50 min local clean builds
~30 min !
Buck HTTP Cache https://github.com/airbnb/BuckSample
None
~5 min !
None
None
Dependency inversion
‣High-level modules should not depend on low- level modules. Both
should depend on abstractions. ‣Abstractions should not depend on details. Details (concrete implementations) should depend on abstractions.
None
A user should be able to wishlist a listing from
the booking flow
None
Easy! WishListDataSource + interface!
None
WishListDataSource is still visible
None
Socializing best practices
!
+60 iOS developers
Automating best practices
Groups Modules
Groups Modules Module Types
Module Types Feature + Interface Service + Interface
Feature A screen or a flow in the app
Service Manage shared state or resources
None
None
How do we enforce these best practices?
/services /service_interfaces /features /feature_interfaces
def service_interface( name, deps): max_visibility = [ "//ios/feature_interfaces/...", "//ios/features/...", "//ios/service_interfaces/...",
"//ios/services/...", ]
service_interface( name = "Networking", deps = [ "//ios/service_interfaces/Logging", ], )
feature( name = "Booking", deps = [ "//ios/service_interfaces/Networking", "//ios/service_interfaces/WishListService", ],
)
iOS Platform
Module creation needs to be easy
None
None
rake make:module
> Provide the type of module you want to create:
1: Non Platform 2: Feature 3: Feature Interface 4: Service 5: Service Interface 4 > New module name: Swiftable > Provide a high level description of this module: This is a module to present at Swiftable
Buck Human readable dependencies https://github.com/airbnb/BuckSample
feature( name = "Booking", deps = [ "//ios/service_interfaces/Networking", "//ios/service_interfaces/WishListService", "//ios/feature_interfaces/HelpCenter",
], )
None
Feature A screen or a flow in the app
None
None
None
Dev Apps
~1 min Dev Apps
Big buckets Small playgrounds
None
How do we get there?
~100 modules One module type: /libraries
libraries/AirbnbBooking libraries/AirbnbBusinessTravel libraries/AirbnbHelpCenter libraries/AirbnbListings libraries/AirbnbNetworking libraries/AirbnbWishLists ...
Before iOS Platform /libraries
On the iOS Platform /services /service_interfaces /features /feature_interfaces
How to get everybody on the iOS Platform?
Remove libraries/ and start over
!
Progressively migrate
Let's migrate WishLists Data Source
libraries/WishLists
None
None
None
What are the dependency rules for libraries/?
None
Inbound dependencies Outbound dependencies
Inbound dependencies Outbound dependencies
None
The interface module has stricter rules
Migrate all the call sites
As the owner of WishLists We don't control these
None
Calculated tech debt
Inbound dependencies Outbound dependencies
None
we know our usage of Networking
We control our dependencies
Allow inbound dependencies from libraries/ Don't allow outbound dependencies to
libraries/
libraries/ has access to the iOS Platform
The iOS Platform doesn't have access to libraries/
Code on the iOS Platform has good boundaries
while we allow for easier migration
def service_interface( name, visibility = []): max_visibility = [ "//ios/feature_interfaces/...",
"//ios/features/...", "//ios/service_interfaces/...", "//ios/services/...", ] add_visibility_for_legacy_module_structure(max_visibility)
def add_visibility_for_legacy_module_structure(visibility): visibility.extend([ "//ios/libraries/...", ])
We started migrating from the bottom up
Try it ourselves !rst
Pilot with others teams
Should I implement this?
Most likely NO
There's no silver bullet
Adapt
Summary 1. Figure out where you're struggling 2.Create and document
best practices 3.Automate best practices where needed
¡Gracias! franciscodiaz.cl/talks