Using Amazon S3 for the photo storage

0 votes

I'm going to be using S3 to store user-uploaded photos. Obviously, I won't be serving the image files to user agents without resizing them down. However, not one size would do, as some thumbnails will be smaller than other larger previews. So, I was thinking of making a standard set of dimensions scaling from the lowest 16x16 to some highest 1024x1024. Is this a good way to solve this problem? What if I need a new size later on? How would you solve this?

Oct 26, 2018 in AWS by datageek
• 3,090 points

1 answer to this question.

0 votes

Pre-generating different sizes and storing them in S3 is a fine approach, especially if you know what sizes you need, are likely to use all of the sizes for all of the images, and don't have so many images and sizes that the storage cost is excessive.

Here's another approach I use when I don't want to pre-generate and store all the different sizes for every image, or when I don't know what sizes I will want to use in the future:

  1. Store the original size in S3.

  2. Run a web server that can generate any desired size from the original image on request.

  3. Stick a CDN (CloudFront) in front of the web server.

Now, your website or application can request a URL like /16x16/someimage.jpg from CloudFront. The first time this happens, CloudFront will get the resized image from your web server, but then CloudFront will cache the image and serve it for you, greatly reducing the amount of traffic that hits your web server.

answered Oct 26, 2018 by Archana
• 5,640 points

Related Questions In AWS

0 votes
1 answer

How do I create an alarm for my load balancer using the Amazon EC2 console?

Follow these steps: Open the Amazon EC2 console On ...READ MORE

answered May 17, 2019 in AWS by Rhea
0 votes
0 answers
0 votes
1 answer
+4 votes
5 answers

Usage of Amazon Cloudfront or S3

When to use S3? S3 is like many ...READ MORE

answered Apr 3, 2018 in AWS by brat_1
• 7,200 points
+3 votes
6 answers

Renaming files in S3

You can either use AWS CLI or ...READ MORE

answered Oct 16, 2018 in AWS by petter dj
0 votes
1 answer

S3 Static Website Hosting Route All Paths to Index.html

Yes there is an easy way to ...READ MORE

answered Apr 8, 2018 in AWS by code_ninja
• 6,290 points
+1 vote
4 answers

Can a URL be directly uploaded to S3 using POST?

You can read this blog and get ...READ MORE

answered Oct 25, 2018 in AWS by chamunda
+1 vote
2 answers

How to read a csv file stored in Amazon S3 using csv.DictReader

The code would be something like this: import ...READ MORE

answered Oct 25, 2018 in AWS by Archana
• 5,640 points
0 votes
1 answer

Error when uploading image using Amazon S3

You are using the php's default method POST ...READ MORE

answered Mar 25, 2019 in AWS by Archana
• 5,640 points
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP