PostgreSQL needs a new load balancer
databasesoup.com
databasesoup.com
Then there are bugs. Sure: As they are discovered, they get solved quite quickly, but if you are depending on certain functionality, it can still be very annoying.
It's also touted as a HA solution, but from my own experience last year, I greatly increased the overall stability of an installation by getting rid of pgpool - there's too much magic going on in there.
Finally, I was quite unhappy about them silently fixing a case where an unauthenicated client could request all the servers memory to be consumed. No security announcement - not even a release was made.
Unless you are very willing to spend a lot of time working around quirks and deeply familiarizing yourself with the source code, I would recommend against pgpool at this time, which leaves us, again, without any general-purpose load balancing solution. Other solutions have restrictions that make them quite situational (no prepared statements, non-deterministic cleanup after the client disconnects, etc).
I've given up on using an explicit load balancer (pgpool scales badly and is temperamental as you write). The application itself now handles load balancing, swapping out database connectors depending on whether it requires writes / no-lag reads.
The current replicated PostgreSQL setup I have uses WAL-E for continuous archiving / backup (it recently got support for non-US-East S3 buckets[1]) and repmgr for replication management (hasn't seen a release in a year and the documentation is somewhat sparse). Don't get me wrong, I like and respect both projects, but I have less confidence in and more complications from them than PostgreSQL.
Doing the failover is trivially done using something like keepalived or heartbeat as Postgres has built-in support for quickly promoting a slave to the master.
What we don't have, however is good load balancing. Also, because load balancing is f'ing hard to get right when you are in a master/slave replication configuration because it's really hard to know what queries you can safely send to the slave. After thinking quickly, here are some cases: use of nextval/currval, use of select after insert/update in a transaction, querying unlogged tables, and probably many more.
A good load balancer knows about all of this.
I'd love for PgBouncer to poll the servers it's connected to and automatically talk to the master, so in case of master failure I would only have to promote a new master (and STONITH) and PgBouncer would auto-failover to the new master.
And the VPN server may very well become a bottleneck for transfer speed at some point, but most of us won't ever need to deal with a level of bandwidth where that's an issue.
Site-to-site VPN would not have been an option in this instance, and in general I have had poor experience with them - Flaky SPOF, poor throughput, and so on.
Heh.
Context: https://wiki.postgresql.org/images/thumb/a/a4/PostgreSQL_log...
Side node: if you want load balancing, no replication, yes then it's easy to do :)