Dropbox Mike Nakhimovich Jan 15, 2020

Store Grand Re-opening: Loading Android Data with Coroutines

Article Summary

Dropbox just took over Store, the popular Android data loading library, and rewrote it from scratch in Kotlin. The reason? RxJava was making it too easy for developers to leak memory.

Originally created at the New York Times, Store (3,500+ GitHub stars) helps Android apps manage data fetching, caching, and sharing. Dropbox rebuilt it as Store 4 using Kotlin Coroutines and Flow to align with modern Android architecture and solve critical memory management issues.

Key Takeaways

Critical Insight

Store 4 provides production-ready repository pattern implementation with memory caching, disk persistence, request deduplication, and guaranteed leak prevention through Kotlin's structured concurrency.

The article reveals how Store's inflight debouncer handles 12 simultaneous requests for the same data at app startup without breaking a sweat.

About This Article

Problem

Android apps were using too much data because RxJava's disposable-based subscription model made it easy for engineers to forget calling dispose(). This directly caused memory leaks in embedded systems that had limited resources.

Solution

Dropbox rewrote Store 4 in Kotlin using Flow's suspend functions. These enforce structured concurrency by requiring coroutine scope definition at creation time, rather than relying on manual disposal later.

Impact

Store's built-in inflight debouncer prevented duplicate requests for identical data. After the New York Times implemented it, data usage dropped significantly.