This project demonstrates transfer of objects like images, videos, documents etc. directly to AWS S3 from client on browser without requiring the server to proxy the data transfer.
- Author: Sakthi Santhosh
- Created on: 30/12/2023
Create a user in the IAM Console with the necessary policies to access S3, assign credentials to it and download the credentials.
The goal of this project is to reduce the load on the server while uploading objects like images, documents, videos etc. by allowing the client direct access to the storage, which is AWS S3 here.
Following are the architectural diagrams and flow diagrams involved in this project.
Note: The Flask server can either be run locally or on AWS EC2. For this project, the server and the client are run locally. If run on server, there is no need to create a user in IAM Console and download the credentials. Instead, create a IAM Instance Profile for the EC2 Instance you're using.
In this flow, the server has to upload the image to the S3 bucket before responding to the client's request. This blocks the server until the object is transferred to the bucket (if not handled asynchronously or multi-threaded), or increases the load on server.
In the improved flow, the image upload is taken care by the client. The server stores the metadata and returns a temporary upload link to the S3 Bucket.
This is a learning and development project and I discourage submitting issues/pull requests. The repository has been kept public only for learning purpose.