English 中文(简体)
How and where to store user uploaded files in high traffic web farm scenario website?
原标题:

i am working on a website which deploy on web farms to serve high traffic. where should i store user uploaded files? is it wise to store uploaded files in the file system of the same website and synchronize these files in all web servers(web farm)? or should i use another server to store all uploaded files in this server to store files in a central location? if separate file server will be a better choice, than how can i pass files from web server to that file server efficiently? or should i upload files directly to that file server?

最佳回答

For security reasons you want to serve the files from a different sub-domain anyways. This is easier by dedicating one server for these files, if the traffic for these files warrants it, but that also creates a single point of failure and bottleneck which you probably want to avoid.

You can have all web servers serve the files from a central file server or local cached copies. This depends a lot on if the files ever change.

问题回答

Have you considered using Amazon S3 to store and serve user-uploaded files?

Otherwise, a central file server in your data center makes sense. You could mount the storage locally on each of your web servers using NFS or similar.

However you choose to store these files, you should always serve user-provided files from a different domain to avoid cross-domain exploits.

You asked about how Facebook stores photos. You might want to read the following article:

Needle in a haystack: efficient storage of billions of photos





相关问题
Java shell expansion similar to wordexp

Is there a way to do shell wildcard expansion in java similar to the way that the C function call wordexp works? It seems a bit platform specific, but there has to be a nice abstraction for this in ...

How to evaluate a file system?

I ve a question related to design of file systems. These days we are seeing the proliferation of many file systems mostly related to handling large datasets and providing high availability and speed. ...

Storing files on the Cloud or the FileSystem? [closed]

Simple question, doesn t seem to have been directly asked yet. What are the benefits to storing files (images/videos/documents/etc) on Amazon S3-and-related vs. on the File System your app is ...

Is this specific path concatenation in Perl code exploitable?

Assume that an attacker controls the variable $untrusted_user_supplied_path. Is the following Perl code exploitable? my $untrusted_user_supplied_path = ... if ($untrusted_user_supplied_path =~ /../)...

How to determine how much free space on a drive in Qt?

I m using Qt and want a platform-independent way of getting the available free disk space. I know in Linux I can use statfs and in Windows I can use GetDiskFreeSpaceEx(). I know boost has a way, ...

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签