I have an application written in a Django framework that draws off a PostgreSQL database.
Because we're very sensitive of downtime and redundancy, the database uses streaming replication to two hot-standby servers. However, as it currently stands when the master DB goes down I have to manually change the database server address in settings.py
for Django to switch over.
I'm not terribly familiar with Django database routing yet, so I'm not sure how to go about it, but would it be possible to configure all three databases in Django to have the routing layer automatically determine which one of them is currently the active master and route its queries accordingly?
(During run time would be perfect, but I'll cheerfully settle for 'at start up' and add a line in the procedures document to restart the uwsgi vassal when reacting to a database failover).