Answer the question
In order to leave comments, you need to log in
Working with replicated DBMS in python?
I have several python servers that connect to PostreSQL via psycopg2 (2 servers in master-slave mode). According to the logic of work, python reads a lot from the database and occasionally writes to it. Are there packages that make it easier to connect to a database cluster (automatically switch connections to a replica in case of a master failure, distribute selects between the master and slaves)?
Answer the question
In order to leave comments, you need to log in
There is a
way , but it has nothing to do with Python. The solution is solely to improve the fault tolerance / load balancing of the database, and whether the client of this solution will be Python, Java, PHP, etc - does not matter.
pgpool-II
Even if there are packages, I'm not sure they make life easier. Such things should be at your fingertips, you need to absolutely understand at what point what behavior is expected. This is not a simple library with a simple contract that you plug in and forget. The same goes for tools like pgpool. Until you thoroughly understand his work, you will get up on a rake. Writing for yourself, however, is also difficult. You still have to step on all the rakes. So there is probably no silver bullet here.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question