ASP MVC Big Gallery 网站图像存储最佳实践
我有一个客户想要建立一个巨大的图片库网站,我对如何构建该网站以适应未来的存储扩展感到困惑。
让我解释更多...
让我们说每个用户都会将他的图像上传到
website.com/Uploads/User/Images
现在创建上传逻辑并显示图像不是我的问题,我真正的问题是说我有200 GB 硬盘,如果我有 20000 个客户,每个客户最多上传 10 MB,现在如您所见,我将耗尽空间。
那么我如何在不改变网站结构的情况下处理未来的扩展,这意味着用户将始终上传到我上面提到的相同路径,所以显然我的前端视图也会从同一位置获取图像。
这可能很愚蠢,但我对此迷失了。我的意思是,像 Facebook 或其他大型网站这样的人是如何做到这一点的?
I have a client who wants to build a huge Image gallery website, and I am confused about how to structure the website for future Storage expansion.
Let me explain more...
Let us say that each user will upload his images to
website.com/Uploads/User/Images
Now creating the upload logic and displaying the images is not my issue here, my real problem is that say I have 200 GB hard Disk and if i have 20000 Customer where each client uploads 10 MB max, now as you see I will run out of space.
So how do I handle expansion in future without changing structure of web site, meaning that users will always upload to the same Path I have mentioned above, so obviously my front-end views will fetch images from same location too.
It may be stupid but I am lost on this. I mean, how guys like Facebook or other big sites do that ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以尝试使用云cdn(内容分发网络),它将动态扩展。 amazon/rackspace,他们以此类服务而闻名。
You can try using a cloud cdn(content delivery network), which will be dynamically expandable. amazon/rackspace, they are well known for this kind of service.
好的,经过繁琐的搜索,我找到了答案,基本上可以归结为两种方法,
一种称为推送,您必须通过 FTP、Api 等将文件存储在 CDN 服务器上...
另一种称为拉源,其中您无需更改任何内容,只需配置 CDN 即可从服务器获取资源,当然您必须首先将文件存储在原始服务器上。
还有很多内容,但如果有人有我同样的疑问,只需在 Google 中搜索有关 CDN Push 或 Pull 的内容即可
Ok after Tedious Searching, i have found the answer, basically it boils down to two Methods,
One Called Push, where you have to store the Files on the CDN Server by FTP, Api, etc...
The other called Pull Origin, where you dont have to change anything, you just Configure Your CDN to Fetch the Resources from your Servers, of course you have to Store files on Original Server First.
there is a lot more to it, but if anyone had my same wondering , just make Search about CDN Push or Pull in Google