复制存储在文件系统中的上传图像
您好,我目前正在编写一个应用程序,允许用户上传图像,这些图像存储在文件系统上,并在数据库中引用。但是,我有多个应用程序服务器需要将这些文件复制到其中。
做这样的事情有哪些常见的方法?我可以实施什么特别好的工具/方案来做到这一点吗?
编辑:格式化
Hi I am currently writing an application that allows users to upload images, which are stored on the filesystem with a reference in the database. However I have multiple application servers which these files need to be replicated to.
What are common methods for doing something like this? Are there any particularly good tools/scheme I can implement to do this?
edit:formatting
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要复制文件,我将使用 rsync。
假设您有多个编写者,数据库中引用的复制可能会更复杂,并且取决于 DBMS 和引用分配方案。
To replicate files, I would use
rsync
.Replication of references in the database, assuming that you have multiple writers, may be more complicated and depends on the DBMS and reference assignation scheme.
考虑使用现有的文件存储平台,例如 Amazon.com 的 S3。它将允许您直接从用户的服务中提供用户的图像。
Consider using an existing file storage platform such as Amazon.com's S3. It would allow you to server user's images directly from their service.