简体   繁体   English

在AWS的S3或EFS中何处存储数千个图像?

[英]Where to store thousands of images in S3 or EFS of AWS?

I will make a project in the not too distant future, a project where we will be storing thousands of thousands of images in the course of time. 我将在不久的将来创建一个项目,这个项目将在一段时间内存储成千上万的图像。 I'm on a hard decision whether to use Amazon S3 or EFS to store those images. 对于使用Amazon S3还是EFS来存储这些图像,我有一个艰难的决定。 Both I think are a very good option, but my question goes to what would be the best service or what would be the best practice? 我认为两者都是很好的选择,但是我的问题是什么是最好的服务或什么是最佳实践?

My application will be done with Laravel and I already did the integration of both services. 我的应用程序将使用Laravel完成,并且我已经完成了这两种服务的集成。

Most of the characteristics of the project are: 该项目的大多数特征是:

  • Most of the files I will store will be photos about 95%. 我将存储的大多数文件将是约95%的照片。
  • Approximately 1.5k photos would be stored daily. 每天大约存储1.5k张照片。
  • The photos are very large (professional cameras). 照片非常大(专业相机)。
  • Traffic to the application will not be much, approx. 到应用程序的访问量不会很大,大约为。 100 users at a time. 一次100个用户。
  • Each user would consult about 100 photos per day. 每个用户每天查阅约100张照片。

What dou you recommend? 您推荐什么?

S3 is absolutely the right answer and practice. S3绝对是正确的答案和实践。 I have built numerous applications like you describe, some with 100s of millions of images, and S3 is superior. 我已经构建了许多您所描述的应用程序,其中一些应用程序具有数以亿计的图像,而S3更为出色。 It also allows for flexibility such as your API returning the images as pre-signed URLs which will reduce load to your servers, images can be linked directly via static web hosting, and it provides lifecycle policies to archive less used data. 它还提供了灵活性,例如您的API将图像作为预先签名的URL返回,这将减少服务器的负载,图像可以通过静态Web托管直接链接,并且提供了生命周期策略来存档较少使用的数据。 Additionally, further integration with other AWS services is easy using event triggers. 此外,使用事件触发器可以轻松地与其他AWS服务进行进一步集成。

As for storing/uploading, S3 multi-part upload is very useful to both increase performance and increase reliability. 对于存储/上传,S3分段上传对于提高性能和提高可靠性非常有用。

EFS would make sense for your type of scenario if you were doing some intensive processing where you had a cluster of severs that needed lower latency with a shared file system - think HPC. 如果您要进行一些密集的处理,而其中的服务器集群需要通过共享文件系统降低延迟,那么EFS对于您的方案类型来说是有意义的-请考虑一下HPC。 EFS would also come at a higher cost and doesn't provide as many extensibility options or built-in features as S3. EFS的成本也更高,并且无法提供与S3一样多的可扩展性选项或内置功能。 Your scenario doesn't sound like it requires EFS. 您的方案听起来好像不需要EFS。

http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html

http://docs.aws.amazon.com/AmazonS3/latest/dev/ShareObjectPreSignedURL.html http://docs.aws.amazon.com/AmazonS3/latest/dev/ShareObjectPreSignedURL.html

http://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html http://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html

http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html

http://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html http://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html

For the scenario you proposed AWS S3 is the choice. 对于您建议的方案,选择AWS S3。 Why? 为什么?

  • Since images are more often added, it costs roughly 1/10 th of EFS. 由于通常会添加图像,因此其成本约为EFS的1/10。
  • Less overhead on your web servers since files can be directly uploaded and downloaded with S3. 由于可以使用S3直接上传和下载文件,因此Web服务器上的开销更少。
  • You can leverage event driven processing with Lambda eg Generating thumbnail, Image processing filters by S3 Lambda trigger. 您可以通过Lambda使用事件驱动的处理,例如,通过S3 Lambda触发器生成缩略图,图像处理过滤器。
  • Higher level of SLA for availability and durability. 更高级别的SLA,以提高可用性和耐用性。
  • Supporting for inbuilt lifecycle management to archival and reduce cost. 支持内置的生命周期管理以存档并降低成本。

AWS EFS can also be an option if it happens to frequently modify the images (Where EBS is also an option) 如果AWS EFS经常修改图像,则也可以选择使用AWS EFS(在EBS也可以使用的情况下)

You can also consider using AWS CloudFront with either the option to cache images. 您也可以考虑将AWS CloudFront与任一选项一起使用来缓存图像。

Note: At the end its not about using a single service. 注意:最后,它与使用单个服务无关。 Based on your upcoming requrements you can choose either one of them or both. 根据即将到来的需求,您可以选择其中之一,也可以选择两者。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM