Database replication should be easy with MySQL, I am currently using
master-slave replication for backups, so configuring master-master
wouldn't be a big deal (as I hope). But I am wondering how to handle
file uploads?
First way which come into me mind was cross-exporting upload
directories via NFS and slightly modifying file_column plugin.
Another way is to store files in database, so MySQL replication will
be used and than perform some way of caching (reading big files from
database again and again doesn't look like a good idea to me).
Never *ever* store images in the database especially if you are doing replication or master master, sotring images in the db is very inefficient and will completely hose replication on the regular.
NFS can work but has locking issues and is not POSIX compliant and is also fairly slow. If you have a SAN then you can use GFS from the red hat cluster suite to get a posix compliant clustered filesystem.
Thanks for replication explanation. GFS looks like a good way, but I
think that it has two drawbacks:
- introducing another single-point-of-failure
- SAN requirement
I would like to make this happen with two servers only + loadbalancer
and pretty low-cost - applications are not heavy loaded, but failover
would be a great feature.
Is there eg. some way how to replicate directory via rsync/SSH/
whatever through daemon? There will be only a minimum file-upload
operations, so having not-so-realtime replication of files would be
sufficient.