0

In my web application, each user will have a logo. I am pretty sure each user will also have a photo gallery in the future. What is the best way to set up a directory structure for managing user logos and possibly other assets such as photos? Also would be good to get people's opinions on what to store in the database. My application is a Rails app.

Just to be clear, this web application will need to scale to possibly hundreds of thousands of users.

4

2 回答 2

2

有些插件可以为您想要做的事情提供功能。

从本质上讲,它们的工作方式与 Pindatjuh 所建议的类似。但是你应该检查 附件-fu回形针,看看其他人是如何做到的。

于 2010-01-18T00:22:36.497 回答
0

If it's a small web application and you have a database:

One folder containing all avatars (logos). In the database you set the filename of the avatar. Also another folder containing all photo's in a gallery. In the database you have one entry for each asset, pointing to the resource and user.

如果它是一个更大或不断增长的应用程序,您可以自动创建更多文件夹(脚本:每 100 个文件创建一个新文件夹),甚至可以通过让多个服务器单独提供资产来实现负载平衡。

如果您没有数据库:

为每个用户创建一个文件夹,其中包含他们的头像和资产。这个不会增长,因为您没有指向用户资产的数据库:如果您有多个服务器,则不能说资源在“哪个”服务器上。

于 2010-01-17T23:25:24.170 回答