Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a way to handle database connection failure in Django 1.2?

What is a way to handle database unavailability and redirect queries from unavailable slave to another one in Django 1.2?

Btw, i found out, that it was discussed: http://code.djangoproject.com/wiki/MultipleDatabaseSupport#Requirements (see "Transparently handling database failure")

UPD> I use PostgreSQL backend (probably will use pg pool or some other potgres cluster) under linux

like image 550
DataGreed Avatar asked Jul 08 '10 17:07

DataGreed


1 Answers

If you are using a PostgreSQL backend and are on a Linux/BSD etc. system, consider using pgpool: http://www.pgpool.net/ This utility handles the connections to the DB server for you, so you only connect to pgpool. No need for you to implement any more logic. Just connect to pgpool, not to PostgreSQL itself.

like image 80
mawimawi Avatar answered Sep 26 '22 15:09

mawimawi