Evolution of Android Message Passing Mechanism
Article Summary
Ju Cai from Coupang reveals how their Android app went from Stone Age message passing to a custom LiveData-based event bus that cut development time in half. The journey through three architectural eras offers a masterclass in scaling mobile architecture.
As Coupang's e-commerce business exploded in the late 2010s, their Android app became a tangled mess of dependencies where simple changes required full regression testing. The engineering team evolved through three distinct phases of message passing architecture, ultimately building ElegantLiveDataBus to decouple modules and enable parallel development at scale.
Key Takeaways
- Stone Age: Basic Handler and broadcasts, simple but memory leak prone
- Iron Age: ViewEventManager event bus, impossible to debug at scale
- Modern: ElegantLiveDataBus with lifecycle awareness and sticky message support
- Results: 50% faster cross-activity development, 60% smaller codebase
- Dynamic proxy binds each message to isolated channels for tracking
Coupang's custom LiveData-based message bus reduced cross-activity development time by 50% and codebase size by 60% while solving lifecycle and memory leak issues.