Question: We have three servers running Ubuntu Server 10.04, load balancing between them through DNS. We use Django, nginx to serve content and PostgresQL as database. 

For PostgresQL, there are some mirroring solutions, but what is the best way to mirror our static files, using "three masters" schema?

I guess just rsyncing them wouldn't be a scalable and easy-to-maintain way.

Answer: 
As long as the files don't change often and must be kept synced at all times, why not rsync? Just make sure you have one master server where you edit the files, that makes syncing easier. 

Other than that, a networked file system like NFS might work, or you implement something like [DRBD](http://www.drbd.org/) to keep the files synced at all times.
There are lots of other solutions (afs, unionfs...), but rsync works surprisingly well for one way replication and is self-healing - and is scalable along as you have defined paths for replication (a single master is fine for up to around 5 slaves, but beyond that there's probably good reason to go to multiple tier replication).

The only issue is with timing of replication. Since you are using round-robin DNS, you already have server affinity - so you're not going to have the problem where a user updates server A then can't see the updates because he's looking at server B. But delays in propogation of code can cause some pain in deployments (particularly if you've got a code dependence on DDL changes to a common database).

If you must have bi-directional replication (try to avoid if at all possible) then yes, a realtime replication system would be more appropriate.

If you are currently running rsync manually / via cron, you might consider using inotify to run the rsync on files as they change such that the delay becomes very short.

C.