Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building Scalable Mobile Projects: Fast Builds,...

Building Scalable Mobile Projects: Fast Builds, High Reusability and Clear Ownership

Every successful project eventually faces the challenges of scaling: an ever-growing codebase, an increasing number of contributors, and rising complexity. Without proper measures, this can lead to slow build times, a cluttered codebase, maintenance difficulties, code duplication, and even dead code—ultimately jeopardizing the company’s ability to deliver value.

Fortunately, there are proactive strategies maintainers can adopt to ensure the project remains scalable and resilient. In this talk, we’ll explore how to structure a mobile codebase to support rising product complexity and accommodate tens of engineers making hundreds of daily commits while maintaining super fast build times, high reusability, and clear ownership.

Cyril Mottier

April 10, 2025
Tweet

More Decks by Cyril Mottier

Other Decks in Programming

Transcript

  1. Abstract Every successful project eventually faces the challenges of scaling:

    an ever-growing codebase, an increasing number of contributors, and rising complexity. Without proper measures, this can lead to slow build times, a clu ffi Fortunately, there are proactive strategies maintainers can adopt to ensure the project remains scalable and resilient. In this talk, we’ll explore how to structure a mobile codebase to support rising product complexity and accommodate tens of engineers making hundreds of daily commits while maintaining super fast build times, high reusability, and clear ownership.
  2. Once upon a time… My awesome app Feature 1 Feature

    3 Feature 4 Feature 2 Feature 5 Feature 7 Feature 8 Feature 6
  3. Backward compatibility Scalability Security Observability Fast build times Quality Cost

    e ff i ciency Testability Fast delivery Reusability Compliance Scalability Collaboration What to optimize for? Static analysis Code locality User experience Encapsulation Customisable delivery Performance Searchability Disaster recovery Flexibility Internationalization Knowledge sharing Strict visibility control Interoperability Developer experience Clear ownership Automation Maintainability
  4. Backward compatibility Scalability Security Observability Fast build times Quality Cost

    e ff i ciency Testability Fast delivery Reusability Compliance Scalability Collaboration What to optimize for? Static analysis Code locality User experience Encapsulation Customisable delivery Performance Searchability Disaster recovery Flexibility Internationalization Knowledge sharing Strict visibility control Interoperability Developer experience Clear ownership Automation Maintainability 😱
  5. Context is key amo example Speed of execution and ability

    to adapt is vital Super competitive consumer social ecosystem
  6. Context is key amo example Ton of features reused in

    1 or multiple apps Speed of execution and ability to adapt is vital Super competitive consumer social ecosystem
  7. Context is key Ton of features reused in 1 or

    multiple apps Speed of execution and ability to adapt is vital Super competitive consumer social ecosystem amo example
  8. Backward compatibility Scalability Security Observability Fast build times Quality Cost

    e ff i ciency Testability Fast delivery Reusability Compliance Scalability Collaboration What to optimize for? Static analysis Code locality User experience Encapsulation Customisable delivery Performance Searchability Disaster recovery Flexibility Internationalization Knowledge sharing Strict visibility control Interoperability Developer experience Clear ownership Automation Maintainability
  9. Backward compatibility Scalability Security Observability Fast build times Quality Cost

    e ff i ciency Testability Fast delivery Reusability Compliance Scalability Collaboration What to optimize for? Static analysis Code locality User experience Encapsulation Customisable delivery Performance Searchability Disaster recovery Flexibility Internationalization Knowledge sharing Strict visibility control Interoperability Developer experience Clear ownership Automation Maintainability
  10. Common pitfalls Modularising by layer vs by feature Creating too

    fi ne/coarse-grained modules Having overly complex API surface Depending on too many modules Exposing overly large feature set
  11. Build System bɪld sɪs.təm/ / Modern mɑː.dɚn A tool to

    coordinate the execution of a reversed topological sort of a directed acyclic graph of actions.
  12. A B D E F C H G Possible order

    of actions C F H B E
  13. A B D E F C H G Possible order

    of actions C F H B E
  14. A B D E F C H G Possible order

    of actions C F H B E D
  15. A B D E F C H G Possible order

    of actions C F H B E D
  16. A B D E F C H G Possible order

    of actions C F H B E D
  17. A B D E F C H G Possible order

    of actions Visual top to bo tt C F H B E D
  18. A B D E F C H G Possible order

    of actions C F H B E D
  19. A B D E F C H G Possible order

    of actions D C F H B E
  20. A B D E F C H G Possible order

    of actions D C F H B E Most edges fi
  21. C F H B E D 2 4 2 6

    1 2 #1 #2 Workers 0 1 2 3 4 5 6 7 8 9 10 11 Unit of time A B D E F C H G
  22. C F H B E D 2 4 2 6

    1 2 #1 #2 Workers 0 1 2 3 4 5 6 7 8 9 10 11 Unit of time A B D E F C H G
  23. H C F B E D 2 4 2 6

    1 2 Workers #3 #2 #1 0 1 2 3 4 5 6 7 8 9 10 11 Unit of time A B D E F C H G
  24. A 5

  25. Correctly sized compilation units Compilation avoidance at all cost “Frequency

    of change” aware DAG The unwavering path Breadth-oriented DAG
  26. Correctly sized compilation units Breadth-oriented DAG Compilation avoidance at all

    cost “Frequency of change” aware DAG The unwavering path
  27. monorepo ├── android ├── bazel ├── ci ├── docs ├──

    ios ├── rs ├── third_party ├── tools └── web
  28. monorepo ├── android │ ├── apps │ ├── build-logic │

    ├── components │ ├── development │ ├── distribution │ ├── documentation │ ├── foundation │ ├── platform │ └── tools └── …
  29. monorepo ├── android │ ├── … │ ├── components │

    │ ├── settings │ │ │ ├── api │ │ │ ├── bindings │ │ │ ├── core │ │ │ ├── core-bindings │ │ │ └── lib │ │ └── … │ └── … └── …
  30. androidx composex coroutinesx coilx … Foundation analytics navigation bug-reporting uni

    fi … Platform api amplitude amplitude-bindings api shake shake-bindings api lib bindings api lib bindings
  31. androidx composex coroutinesx coilx … Foundation analytics navigation bug-reporting uni

    fi ed-map … Platform api amplitude amplitude-bindings api shake shake-bindings api lib bindings api lib bindings best-friend identity pro fi now-playing … se tt Components api lib bindings api lib bindings api lib bindings api lib bindings api lib bindings
  32. androidx composex coroutinesx coilx … Foundation best-friend identity pro fi

    le now-playing … se tt ings Components api lib bindings api lib bindings api lib bindings api lib bindings api lib bindings analytics navigation bug-reporting uni fi ed-map … Platform api amplitude amplitude-bindings api shake shake-bindings api lib bindings api lib bindings location location-instant gra f gra ff … Apps
  33. androidx composex coroutinesx coilx … Foundation best-friend identity pro fi

    le now-playing … se tt ings Components api lib bindings api lib bindings api lib bindings api lib bindings api lib bindings location location-instant gra f gra ff -instant … Apps analytics navigation bug-reporting uni fi ed-map … Platform api amplitude amplitude-bindings api shake shake-bindings api lib bindings api lib bindings
  34. androidx composex coroutinesx coilx … Foundation best-friend identity pro fi

    le now-playing … se tt ings Components api lib bindings api lib bindings api lib bindings api lib bindings api lib bindings location location-instant gra f gra ff -instant … Apps analytics navigation bug-reporting uni fi ed-map … Platform api amplitude amplitude-bindings api shake shake-bindings api lib bindings api lib bindings
  35. androidx composex coroutinesx coilx … Foundation best-friend identity pro fi

    le now-playing … se tt ings Components api lib bindings api lib bindings api lib bindings api lib bindings api lib bindings location location-instant gra f gra ff -instant … Apps analytics navigation bug-reporting uni fi ed-map … Platform api amplitude amplitude-bindings api shake shake-bindings api lib bindings api lib bindings
  36. androidx composex coroutinesx coilx … Foundation best-friend identity pro fi

    le now-playing … se tt ings Components api lib bindings api lib bindings api lib bindings api lib bindings api lib bindings location location-instant gra f gra ff -instant … Apps analytics navigation bug-reporting uni fi ed-map … Platform api amplitude amplitude-bindings api shake shake-bindings api lib bindings api lib bindings
  37. androidx composex coroutinesx coilx … Foundation best-friend identity pro fi

    le now-playing … se tt ings Components api lib bindings api lib bindings api lib bindings api lib bindings api lib bindings location location-instant gra f gra ff -instant … Apps analytics navigation bug-reporting uni fi ed-map … Platform api amplitude amplitude-bindings api shake shake-bindings api lib bindings api lib bindings
  38. androidx composex coroutinesx coilx … Foundation best-friend identity pro fi

    le now-playing … se tt ings Components api lib bindings api lib bindings api lib bindings api lib bindings api lib bindings location location-instant gra f gra ff -instant … Apps analytics navigation bug-reporting uni fi ed-map … Platform api amplitude amplitude-bindings api shake shake-bindings api lib bindings api lib bindings
  39. androidx composex coroutinesx coilx … Foundation best-friend identity pro fi

    le now-playing … se tt ings Components api lib bindings api lib bindings api lib bindings api lib bindings api lib bindings location location-instant gra f gra ff -instant … Apps analytics navigation bug-reporting uni fi ed-map … Platform api amplitude amplitude-bindings api shake shake-bindings api lib bindings api lib bindings
  40. Foundation Components Apps Platform androidx composex coroutinesx coilx … best-friend

    identity pro fi now-playing … se tt api lib bindings api lib bindings api lib bindings api lib bindings api lib bindings location location-instant gra f gra ff … analytics navigation bug-reporting uni fi … api amplitude amplitude-bindings api shake shake-bindings api lib bindings api lib bindings
  41. androidx composex coroutinesx coilx … best-friend identity pro fi now-playing

    … se tt api lib bindings api lib bindings api lib bindings api lib bindings api lib bindings location location-instant gra f gra ff … analytics navigation bug-reporting uni fi … api amplitude amplitude-bindings api shake shake-bindings api lib bindings api lib bindings Foundation Components Apps Platform
  42. Foundation Components Apps Platform androidx composex coroutinesx coilx … best-friend

    identity pro fi now-playing … se tt api lib bindings api lib bindings api lib bindings api lib bindings api lib bindings location location-instant gra f gra ff … analytics navigation bug-reporting uni fi … api amplitude amplitude-bindings api shake shake-bindings api lib bindings api lib bindings
  43. Foundation Components Apps Platform androidx composex coroutinesx coilx … best-friend

    identity pro fi now-playing … se tt api lib bindings api lib bindings api lib bindings api lib bindings api lib bindings location location-instant gra f gra ff -instant … analytics navigation bug-reporting uni fi … api amplitude amplitude-bindings api shake shake-bindings api lib bindings api lib bindings
  44. Foundation Components Apps Platform androidx composex coroutinesx coilx … best-friend

    identity pro fi now-playing … se tt api lib bindings api lib bindings api lib bindings api lib bindings api lib bindings location location-instant gra f gra ff … analytics navigation bug-reporting uni fi … api amplitude amplitude-bindings api shake shake-bindings api lib bindings api lib bindings
  45. Foundation Components Apps Platform androidx composex coroutinesx coilx … best-friend

    identity pro fi now-playing … se tt api lib bindings api lib bindings api lib bindings api lib bindings api lib bindings location location-instant gra f gra ff -instant … analytics navigation bug-reporting uni fi … api amplitude amplitude-bindings api shake shake-bindings api lib bindings api lib bindings
  46. Foundation Components Apps Platform androidx composex coroutinesx coilx … best-friend

    identity pro fi now-playing … se tt api lib bindings api lib bindings api lib bindings api lib bindings api lib bindings location location-instant gra f gra ff … analytics navigation bug-reporting uni fi … api amplitude amplitude-bindings api shake shake-bindings api lib bindings api lib bindings
  47. Foundation Components Apps Platform androidx composex coroutinesx coilx … best-friend

    identity pro fi now-playing … se tt api lib bindings api lib bindings api lib bindings api lib bindings api lib bindings location location-instant gra f gra ff -instant … analytics navigation bug-reporting uni fi … api amplitude amplitude-bindings api shake shake-bindings api lib bindings api lib bindings
  48. @Provides fun provideSettingsConfiguration(): SettingsConfiguration = SettingsConfiguration( socialMedia = listOf( SocialMedia.Instagram(

    “bumpbyamo", R.string.socialMedia_instagram), ), ), ) dependencies { implementation( projects.components.settings.bindings ) } android/apps/location/src/main/LocationAppModule.kt android/apps/location/build.gradle.kts and optionally…
  49. dependencies { happyImplementation( projects.components.superSecretNewFeature.bindings ) } android/apps/location/build.gradle.kts dependencies { implementation(

    projects.components.avatar.bindings ) } android/apps/location-instant/build.gradle.kts dependencies { implementation( projects.components.avatar.bindings ) } android/apps/location/build.gradle.kts
  50. dependencies { happyImplementation( projects.components.superSecretNewFeature.bindings ) } android/apps/location/build.gradle.kts dependencies { implementation(

    projects.components.avatar.bindings ) } android/apps/location-instant/build.gradle.kts dependencies { implementation( projects.components.avatar.bindings ) } android/apps/location/build.gradle.kts