

Once all the file blocks are uploaded, we make a final commit request to the server with a list of all block hashes in the file. First, like many Dropbox systems, we break the file into 4 MB blocks, compute the hash of each block, and upload each block to the server. Then another background worker, the uploader, batch uploads all the photos in the queue. A background worker we call the scanner carefully identifies all the photos (or videos) that haven’t yet been uploaded to Dropbox and queues them for upload. How does this work? When someone takes a new photo or modifies an existing photo, the OS notifies the Dropbox mobile app. For users who don’t open the app for weeks or even months at a time, new photos should still upload promptly. The main value proposition of camera uploads is that it works silently in the background. If you haven’t already enabled camera uploads, you should try it out for yourself. The project shipped successfully, with no outages or major issues error rates went down, and upload performance greatly improved. This post is about some of the design, validation, and release decisions we made while building the new camera uploads feature for Android, which we released to all users during the summer of 2021.

The implementations could then be optimized for each platform and evolve independently, without being constrained by design decisions from the other. This time, Android and iOS implementations would be separate and use platform-native languages (Kotlin and Swift respectively) and libraries (such as WorkManager and Room for Android). In 2019, we decided that rewriting the feature was the best way to offer a reliable, trustworthy user experience for years to come. It was unaware of platform-specific restrictions on background processes, had bugs that could delay uploads for long periods of time, and made outage recovery difficult and time-consuming. Plus, after more than five years in production, the C++ implementation was beginning to show its age. This risk was compounded by a lack of tooling support, and a shortage of in-house C++ expertise. The shared code had grown polluted with complex platform-specific hacks that made it difficult to understand and risky to change. This library served us well for a long time, uploading billions of images over many years. Until recently, camera uploads was built on a C++ library shared between the Android and iOS Dropbox apps.

It’s important that we offer a service they can trust. They care deeply about their photo libraries, and expect their backups to be quick and dependable every time. People who use camera uploads are some of our most dedicated and engaged users. The feature was first introduced in 2012, and uploads millions of photos and videos for hundreds of thousands of users every day. Camera uploads is a feature in our Android and iOS apps that automatically backs up a user’s photos and videos from their mobile device to Dropbox.
