I have a quiz site which creates images from a set of source images, the result images are stored in S3 and i don't care about it. My question is about source images, S3 or EFS is better for storing the source images for this purpose. I am using php to create result images.
-
1If you're already using S3 then you can just stick with that. If you're using both already then EFS would feel more native when writing the PHP code. – apokryfos Sep 06 '17 at 16:23
2 Answers
Here's a general rule for you: Always use Amazon S3 unless you have a reason to do otherwise.
Why?
- It has unlimited storage
- The data is replicated for resilience
- It is accessible from anywhere (given the right permissions)
- It has various cost options
- Can be accessed by AWS Lambda functions
The alternative is a local disk (EBS) or a shared file system (EFS). They are more expensive, can only be accessed from EC2 and take some amount of management. However, they have the benefit that they act as a directly-attached storage device, so your code can reference it directly without having to upload/download.
So, if your code needs the files locally, the EFS would be a better choice. But if you code can handle S3 (download from it, use the files, upload the results), then S3 is a better option.

- 241,921
- 22
- 380
- 470
Given your source images will (presumably) be at a higher resolution than those you are creating, and that once processed, they will not need to be accessed regularly after while (again, presumably), I would suggest that the lower cost of S3 and the archiving options available there means it would be best for you. There's a more in depth answer here:

- 199
- 4
-
If i use S3 for source images it require more bandwidth right ? If i use efs there is no extra cost for bandwidth ? – Samnad Sainulabdeen Sep 06 '17 at 16:44
-
Is your app server in AWS as well? I think data transfer from EC2 to S3 is free within the same region, and also free from the public internet: https://aws.amazon.com/s3/pricing/ – Richard Davis Sep 06 '17 at 16:57
-