How to save media files on AWS with multiple instances of EC2 on AWS

In my application; users can upload videos, and I want to save them to the file system, not the database. If I use Amazon Web Services (AWS) and use only one instance of EC2 with EBS (for storage), that's fine. But if I use autoscaling or multiple instances of EC2; then, if the user uploads the video, he will be saved on one of EC2 (associated with one of the EBS). Next time, if the user logs in (or if the session identity does not exist, and then if the next user request goes to another instance of EC2), how will he access his video?

What is the best solution for this problem? I use S3 the only solution, but for this I can’t just make java.io.File .. I think then I will have to use the AWS SDK api to access the downloaded videos. But won't it be slower?

Is there a better solution?

+5
source share
2 answers

I would use Amazon S3. This is fast, relatively cheap, and works well if you use other Amazon web services.

First, you can download an instance of EC2 and use Simple Workflow Servie to automatically transfer files automatically. This is also useful if you want to transcode the video a few bit rates later.

+4
source

NAS. NFS - GlusterFS. , ...

0

All Articles