I am creating an android application that requires me to upload files to Box.com
and I was wondering if it was safer to upload my files sequentially or concurrently? There are going to be a very large number of files so I'm a little bit worried about doing them concurrently?
Can you please tell me the advantages and disadvantages of both?
Thank you very much for your time and assistance in this matter.
Actually, based on our experiences, I'd have to say sequential is the way to go. Here's why:
Speed: For a typical consumer (not business) network connection, your upload speed is much lower than download speed. Whatever you upload sequentially will probably be using maximum bandwidth, whereas concurrent uploads (2x/3x) might use 1/2 or 1/3 the available bandwidth and each take 2x/3x the time to upload. So, concurrency wouldn't necessarily give you a speed advantage, especially on older devices...
Overhead: If you are handling encryption or compression, etc, yourself, the CPU overhead to do this for parallel uploads will be higher, meaning lower battery life. In any case, I would recommend a library like Retrofit to interact with the API.
Safety: If your network connection is interrupted, concurrent uploads leave you with multiple failed uploads or potentially corrupted files online, while a sequential approach minimizes the risk to one file. Resuming downloads from there should be more manageable than with multiple failed uploads.