Search code examples
amazon-web-servicesamazon-s3html5-videoamazon-cloudfrontaws-sdk

Using AWS S3 alone or S3 & Cloudfront for video download


I've built a Ruby on Rails application which at its core involves users and videos.

There are a few users with admin rights who have the ability to upload videos (rougly 5 minutes each, HD). The rest of the users on the site are only allowed to watch the videos; they themselves do not have the ability to upload. I expect that around 20 videos will be uploaded per week. No more than 2 or 3 thousand users (all in North America) will be watching the videos.

I have two S3 Buckets, let's call them Bucket X and Bucket Y. I've built in Carrierwave to upload the videos to S3 Bucket X, and AWS Elastic Transcoder to take the video from Bucket X, transcode it to Mp4, and place it in Bucket Y.

The resulting video files in Bucket Y are exactly how I want them: web optimized, compressed MP4 format. If necessary, I could serve the videos straight from their url in Bucket Y.

At the same time, however, I am using the AWS Cloudfront CDN to quickly deliver assets and user-uploaded profile pictures to each user.

For a site like mine, where roughly 20 videos of 5 minutes in length are uploaded per week, does it make sense to use Cloudfront?

I have come across articles like this and that, which suggest Cloudfront is appropriate for serving videos. I also have come across others, like this stack overflow answer by Wayne Koorts which suggest Cloudfront is mostly only advantageous in delivering smaller files and may be costly.

Considering that only around 20 videos will be uploaded per week, and the rest are get requests, I am not concerned with the price of using Cloudfront. But, is Cloudfront even worth using in this situation? Will it actually speed up loading times, if we are talking about 5 minute-long videos?

Any help is appreciated. Thank you very much in advance.


Solution

  • This is just too broad, but as you stated that initially your videos will be served only for users in North America, there's no reason to use CloudFront yet. Wait until you have the need to serve to different geographical locations to include it in your architecture.

    Remember AWS says that CloudFront main feature is "Distribute content with low latency and high data transfer rates by serving requests using a network of edge locations around the world."