Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Load Balancing and Failover for Read-Only PostgreSQL Database

Scenario

Multiple application servers host web services written in Java, running in SpringSource dm Server. To implement a new requirement, they will need to query a read-only PostgreSQL database.

Issue

To support redundancy, at least two PostgreSQL instances will be running. Access to PostgreSQL must be load balanced and must auto-fail over to currently running instances if an instance should go down. Auto-discovery of newly running instances is desirable but not required.

Research

I have reviewed the official PostgreSQL documentation on this issue. However, that focuses on the more general case of read/write access to the database. Top google results tend to lead to older newsgroup messages or dead projects such as Sequoia or DB Balancer, as well as one active project PG Pool II

Question

What are your real-world experiences with PG Pool II? What other simple and reliable alternatives are available?

like image 571
Eric J. Avatar asked Oct 28 '25 05:10

Eric J.


1 Answers

PostgreSQL's wiki also lists clustering solutions, and the page on Replication, Clustering, and Connection Pooling has a table showing which solutions are suitable for load balancing.

I'm looking forward to PostgreSQL 9.0's combination of Hot Standby and Streaming Replication.

like image 146
Stephen Denne Avatar answered Oct 30 '25 18:10

Stephen Denne