Strava Artem Sharypov Oct 25, 2019

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

Critical Insight

Strava chose a complete rewrite over patching legacy code, gaining testability and flexibility to support multiple upload formats without risk.

The article reveals the specific architectural pattern that made testing the old service require 'hacky solutions' and how the new design eliminated that problem entirely.

About This Article

Problem

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.

Solution

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.

Impact

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.