在 django 站点上工作,想知道将我的媒体存储在 nfs 安装的分区上是否明智?
首先,我只有使用 php 构建中小型网站的经验,所以如果这个问题看起来很愚蠢,请原谅我。我想知道在已安装的 nfs 共享中存储媒体(用户上传的照片、视频等)是否是常见/接受/明智的做法?我只是打算将所有媒体放在 /media 文件夹中,就像我在 php 中所做的那样,但是在一个巨大的网站上,在一个目录中包含 100 万张以上的图像似乎......不是一种可扩展的方式。
我的 NFS 思路至少走在正确的轨道上吗?
干杯!
First, I only have experience building small-medium sized websites with php so forgive me if this question seems asinine. I want to know if it is a common /accepted/wise practice to store media (user uploaded photos,videos,etc) in a mounted nfs share? I was just going to put all media in a /media folder like I always have done in php, but on a huge site, having 1 million+ images in one directory would seem... not the scalable way to proceed.
Am I at least on the right track with my NFS train of thought?
Cheers!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你可能有点超前了。您以后随时可以将媒体迁移到单独的服务器。无论如何,我认为 NFS 不一定是正确的选择。最好直接从另一个盒子提供媒体。如果您想提前将其设计为可扩展的,请考虑使用GridFS。它很容易在 Python 中使用,您甚至可以将它用作 Django 的存储后端。
I think you are probably getting ahead of yourself. You can always migrate the media to a separate server later. I don't think NFS would necessarily be the way to go anyways. Better to just serve the media from another box directly. If you want to design this to be scalable in advance, think about using GridFS, perhaps. It's easy to work with from Python, and you could even use it as a storage backend for Django.