In the article High Availability with Open Source, Josh Kuo looks at three of the popular Open Source projects to implement High Availability redundancy (failover): Heartbeat, keepalived, and CARP. The article talks about where each of these three excels and some implementation ideas. Josh also mentions the DRBD utility to sync two remote filesystems to aid in an advanced High Availability setup.
Is it possible to sync two(or more) postgresql database in real-time so two different servers on different ip-addresses can serve data with round-robin DNS to their clients?
It all depends on what you are trying to accomplish. The setup that you describe is a real hassle. What you are describing can be achieved by using a master -> master replication setup. See (http://pgcluster.projects.postgresql.org/)
Master-master is really overkill for most users, and it can be a pain to administer. The benefit is that when properly administered you can have a very high uptime.
If you were inquiring because you have a read heavy application and are looking into increasing performance, then you’d probably be better off using something like memcached
There is a Postgres version:
http://people.freebsd.org/~seanc/pgmemcache/
HA, failover and disaster recovery are related. however, given sufficient funds, what is difficult is not the number of nodes in your clusters, your network links or even the instances of the applications you are serving.
what is difficult is the underlying state, or data, relevant to the user interactions with your system, or derived data.
essentially your hardware nodes, links and applications should be architected such that they maintain minimal state, or no state where possible. this has 2 advantages.
1. state-free nodes, links and applications can be brought online very quickly with no need to deal with the difficult issues of state data consistency.
2. you only have a small number of items to worry about regarding your precious data.
from this perspective, you should push down your valuable data onto platforms that are designed from scratch to mainain its availability and its security. SANs stretched across sites is an example. don’t try to do master-master replication at the application level if you can help it. use SANs with built in replication.
large infrastructures use this approach to maintaiin very high resilience – using virtual machines whose state is maintained by very resilient SANs.