安装 Amazon S3 存储桶以在 Web 应用程序中使用
我将很快推出一个网络应用程序,该应用程序将要求用户上传图片以供其他人查看。我想使用 Amazon S3 来存储图像,因为它可以扩展并且价格便宜。用户将使用表单上传文件,该文件将使用 php 进行处理并保存到附加到 Web 服务器的 S3 挂载点。
我期待并希望最终会上传数万或数十万张图像。
我的第一个问题是 S3 存储桶安装对于此类应用程序来说是否足够强大和快速,或者我最好使用 Amazon EBS。虽然我想拥有自己的专用盒子而不是使用 EC2 实例。
另外,我目前对 S3 还不熟悉,但是当我上传文件时,将它们放在一个存储桶中而不是一系列目录中是否合适?看来这可能没问题,因为无论如何每个“桶”都是虚拟的。
I will be launching a web application soon which will require users to upload pictures for others to view. I would like to use Amazon S3 to store the images as it scales and is cheap. The user will use a form to upload their file, it will be processed with php and saved to the S3 mount thats attached to the web server.
I am anticipating and hoping tens or hundreds of thousands of images will eventually be uploaded.
My first question is whether an S3 bucket mount is robust and fast enough for such an application, or would I be better off using Amazon EBS. Although I'd like to have my own dedicated box rather than use an EC2 instance.
Also, I am at this point unfamiliar with S3, but when I do upload files, is it appropriate to put them in a single bucket rather than a cascade of directories? It seems it might be ok since each 'bucket' is virtual anyway.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以做的事情之一是让您的用户直接上传到 S3 存储桶,除非您想要进行一些处理。您可以使用 POST 将文件上传到 S3 或第三方组件之一,例如 http://flajaxian.com/ 这样您就可以显着减轻服务器的负担。
至于你的第二个问题,实际上取决于你如何设计你的应用程序。没有优点和缺点。
One of the things you can do is to have your users upload to S3 bucket directly, unless you want to do some processing. You can use POST to upload the files to S3 or one of the 3rd party components such as http://flajaxian.com/ This way you can significantly offload your server.
As for your second question it is actually up to you how your design your app. there is no pros and cons.