Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Are there any advantages for using one over the other? I'm only looking at options to hide the actual IP address of the master and slave servers from my processes, and not having to restart them if the master fails.

If Nagios detects a failing master, I still want to get involved to do the failover, including telling HAproxy / PgBouncer about the new master.

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

HAProxy is a low lewel high availability and load balancing solution. PgBouncer combines a very good connection pooler and a very limited load balancing for PostgreSQL.

So both has different goals and can not be compared like "vs" in my opinion. Though they can be used in a combination with each other, eg. if one needs to load balance read only queries between several replicas with HAProxy and these replicas are served by their own PgBouncer instances to get pooling advantages.

More about what PgBouncer is and what it is not in is perfectly described in this blog post.

share|improve this answer
add comment

PgBouncer works at a higher level, mapping N incoming connections to M database connections, whereas HAProxy by nature is a 1:1 mapping. So this provides a line of defence against clients holding idle connections, for example, which isn't possible with HAProxy (at least, not as cleanly, I think).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.