Sandeep
Sandeep

Reputation: 1815

multiple web server machines + 1 DB server - how to handle uploaded files synchronization?

we have 3 webservers (apache + PHP) on three different machines, talking to a database machine. Our application allows users to upload their own images. The uploaded images are stored and mapped to a local drive on the machines. Let me first admit that we never engineered our application to be distributed. In tha above scenario, what we see is that the images are uploaded and stored on one server and are not available to the others.

What is the current state of the art for upload content - is it something like S3 or exporting a file system over NFS (security issues ?), or is it something like an image server which allows you to do that ?

Upvotes: 2

Views: 571

Answers (2)

Josh Smeaton
Josh Smeaton

Reputation: 48710

We just map shared drives on our SAN. CDN's are also a viable option. You just need shared disk space somewhere. Whether that is in the 'cloud', or on a SAN, or a simple shared network drive somewhere.. it doesn't matter.

Upvotes: 0

Kieran Allen
Kieran Allen

Reputation: 942

Here are just a few of many solutions:

  1. Storing them in a Database
  2. Separate server, with Varnish/Squid in front. (in-memory cache) you can use rsync or some other tool to keep this up to date.
  3. A CDN (although, i'd combine it with #2)

Mix and match!

This may be overkill for you.. but this is how Facebook do it: http://www.facebook.com/note.php?note_id=76191543919

Upvotes: 1

Related Questions