Upload to S3, iOS, or Node.js

I am working on an iOS app that will download images and videos and save them for each user. I was able to integrate amazon s3 and do the download from an iOS app, I already have a node.js server that I am saving the file metafile I saved to S3 and the S3 ID I got from iOS. My question is, is the architecture good, or should I move the S3 save operation to the backend? how do other apps do it (like instagram / vine) if the mobile handles it or the backend?

thank

+3


source to share


1 answer


What you are doing is considered best practice: Let mobile devices boot directly and securely to S3.

Documentation:



You must ensure that only your users can upload objects to S3 by creating the correct IAM policy. Depending on how you authenticate your users, Cognito Identity can help you book identity toners obtained from third party vendors (such as Google, Facebook or Amazon), or your own (OpenID Connect token) with AWS STS to obtain a temporary access key and secret key.

Documentation:



Direct download allows your application and your user base to scale without requiring additional processing power on the backend. S3 is a massively parallel object store, it will handle your mobile fleet traffic, offloading you from low-level tasks like monitoring, scaling, fixing, ... your server.

Now that Lambda is available (in preview mode), you might also consider grabbing metadata about the S3 object in a Lambda function and loading the metadata into your backend store (DynamoDB or relational database) directly from the lambda. Given the generous use of Lambda in the free layer, this solution would be much more economical than using your own backend. You are familiar with Node.JS, the framework used by Lambda, so there will be almost no learning curve for you.

Documentation:



+6


source







All Articles