A Summer of Android at Strava
Article Summary
Artem Sharypov from Strava's Experience team rebuilt their entire Android upload service from scratch. Why throw away working code? Because sometimes technical debt costs more than a rewrite.
During his 2019 summer internship, Artem tackled a critical infrastructure challenge: migrating Strava's Android activity uploads from JSON to FIT file format. The existing service worked, but its rigid architecture made it nearly impossible to support both formats simultaneously without introducing bugs.
Key Takeaways
- FIT files are smaller than JSON, reducing upload failures on poor connections
- New architecture uses TaskRunner pattern with RxJava for testable, format-agnostic uploads
- Separate upload queues and polling logic made old system impossible to debug
- Task-based design allows independent retry strategies for JSON and FIT uploads
Strava chose a complete rewrite over patching legacy code, gaining testability and flexibility to support multiple upload formats without risk.
About This Article
Strava's original upload service had two separate queues managed by different classes. Developers had to remember which queue handled specific states and when to switch between them. This made the codebase hard to understand and maintain.
Artem Sharypov's team built an UploadManager to control upload flow across multiple threads. A TaskRunner intermediary manages a unified task queue and passes results through a single callback handler using RxJava.
The new architecture removed the hacky dependency injection solutions that were needed for testing. Developers can now test any combination of upload components without breaking the existing service.