G
G
Gard2012-10-09 13:53:45
Python
Gard, 2012-10-09 13:53:45

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

2 answer(s)
S
subvillion, 2012-10-09
@subvillion

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

D
dborovikov, 2012-10-21
@dborovikov

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 question

Ask a Question

731 491 924 answers to any question