I have an iOS app that communicates to a REST API I developed. I am using Amazon S3 for storage of image and audio files. Right now I am able to upload/download the files directly from the mobile app (client). I am currently facing some issues with the speed of upload/download of small files (15-20 kB), as well as other problems such as Amazon S3 not allowing a time skew of more than 15 min (meaning if my customers have their time zone or date-time configurations incorrect, they would not be able to upload/download these files from S3.
I am now facing an architectural decision towards these issues, that is, uploading/downloading the files from S3 to my own API, store them temporarily and upload/download them to the mobile client. In other words change from this:
S3 <----> iOS <----> REST API
to this:
S3 <----> REST API <----> iOS
Advantages:
- All data is processed and handled by API
- No problems if client and storage (S3) are out of sync (time skew)
- Customer's phone communicates with only one web service
Disadvantages:
- All file transfers are a two way process
- API's web traffic increases substantially
- Increased chance of data/packet loss thus having to repeat the whole process
What would be the best choice? Leave it as is, or start developing file transfers through my own API?