2 ms·
Don't do this in Django. Just don't. This should be done with a database proxy server. With MySQL, you can use MySQL Proxy and PostgreSQL has pgpool-II. Yes
by mdasen 18y ago
Don't do this in Django. Just don't.
This should be done with a database proxy server. With MySQL, you can use MySQL Proxy and PostgreSQL has pgpool-II.
Yes, you could hack the Django code to solve your problem. Why do that when there is a very simple and tested product that already does that transparently? For me, supporting multiple databases in a web framework is akin to writing an HTTP server into your web framework. Maybe you should do it for testing purposes, but not for production.
- ii 18y agoThere are reasons why mysql_replicated backend was created and used successfully in production instead of MySQL Proxy. For example, MySQL Proxy knows nothing about transactions.