Postgresql – Suggested ways to route traffic between master / slave

postgresqlpostgresql-9.3replication

I have multiple Postgres servers up, running in master / slave streaming replication mode.

I was wondering what the suggested methods of routing write traffic to the master, and the read traffic to the slave nodes.

Best Answer

PgPool-II can do this, with some limitations, as outlined in its user manual.

The best way is to make the application aware of which queries are read-only/poolable, and which are write queries that must go to the master.

There aren't really any other alternatives at this point.