Dropbox Sarah Tappon and Andrew Haigh Mar 16, 2022

Making Camera Uploads for Android Faster and More Reliable

Article Summary

Dropbox rewrote their Android camera uploads feature from scratch. It took 2 engineers 2 full years, but first-time uploads now finish 4x faster.

The original camera uploads feature ran on shared C++ code between iOS and Android. After 5+ years in production, it struggled with Android's background restrictions and had grown too risky to maintain. The team rebuilt it in Kotlin with platform-native tools.

Key Takeaways

Critical Insight

The rewrite delivered immediate reliability gains and positioned the team to iterate faster as Android continues evolving.

Their hash validation in production uncovered a rare bug in the old C++ code that nobody knew existed.

About This Article

Problem

Dropbox's C++ camera uploads had a rare hashing bug. The Kotlin and C++ implementations disagreed on photo hashes about 0.005% of the time, which could cause duplicate uploads or missed photos when de-duplication failed.

Solution

The team ran the Kotlin hashing code alongside C++ in production. They compared the outputs and checked server rejection logs to figure out which implementation was actually correct before rolling out the full deployment.

Impact

The validation process showed that the C++ hashes were wrong and uncovered a bug nobody had caught before. This gave the team confidence that the new Kotlin implementation was correct before they released it.