Postgres

http://www.postgresql.org/docs/current/static/high-availability.html
https://cloud.google.com/solutions/setup-postgres-hot-standby
http://highload.guide/blog/query_performance_postgreSQL.html

repmgr is an open-source tool suite to manage replication and failover in a cluster of PostgreSQL servers
http://www.repmgr.org/

Bi-Directional Replication (BDR) is an asynchronous multi-master replication system for PostgreSQL
http://2ndquadrant.com/en/resources/bdr/