# App Modularisation at Scale

[Grab](https://yomu.fyi/company/grab) · Amar Jain · Jul 13, 2021

**Type:** Problem & solution

## Summary

Grab transitioned its monolithic mobile application into a modular architecture to resolve increasing code conflicts, slow releases, and difficult team collaboration. The team decomposed the single module by establishing base infrastructure modules, shared UI and utility libraries, discrete feature modules, and bridge kit modules for inter-module communication. Dependency injection using Dagger ties these components together in the main app module while preventing feature modules from directly depending on one another. The architecture spans over 1,000 modules across the app, with more than 200 modules in the Grab Financial Group payments domain where over 95% of modules build in under 15 seconds. This approach accelerated Gradle CI and local builds through parallel compilation and caching, though it increased Gradle sync times, IDE memory usage, and configuration maintenance overhead.

## Context

Grab's monolithic app architecture placed all UI and business logic in a single module, leading to heavy code coupling, frequent code conflicts, slower development cycles, and difficult collaboration as new features and engineers were added.

## Approach / What changed

The engineering team decomposed the codebase by creating Base/Core infrastructure modules, Shared Library modules, independent Feature modules, Kit modules for inter-module communication abstractions, and an App hub module using Dagger dependency injection.

## Takeaways

- Preventing feature modules from directly depending on each other enables Gradle to build independent modules in parallel across CPU cores.
- The modular architecture reduced build times in the Grab Financial Group payments domain so that more than 95% of its 200+ modules build in less than 15 seconds.
- Modularisation trade-offs include higher IDE memory usage, increased Gradle sync times, and the ongoing maintenance of separate configuration files per module.

**Tags:** [Architecture](https://yomu.fyi/topic/architecture), [Developer Experience](https://yomu.fyi/topic/developer-experience), [Monoliths](https://yomu.fyi/topic/monolith), [Performance](https://yomu.fyi/topic/performance), [Refactoring](https://yomu.fyi/topic/refactoring)

[Read original post](https://engineering.grab.com/app-modularisation-at-scale)
