[Dovecot] PostgreSQL driver supporting [round-robin] load balancing and redundancy [LONG]

Rainer Weikusat rweikusat at mssgmbh.com
Wed Apr 14 22:48:13 EEST 2010


Timo Sirainen <tss at iki.fi> writes:
> On Wed, 2010-04-14 at 20:56 +0200, Rainer Weikusat wrote:
>> Multiple connections can be specified in an ordinary connect-string by
>> separating the necessary parameters with a ;;;-sequence. For the
>> server I was writing about above, this looks like:
>> 
>> connect = host=1.1.1.1 dbname=mailgate user=mailgate_user password=secret sslmode=require ;;; \
>>         host=2.2.2.2 dbname=mailgate user=mailgate_user password=secret sslmode=require
>
> I'll look at this patch more closely later, but is it really necessary
> to support completely different connect strings for different
> servers?

Given that the connect string is essentially an opaque value which is
passed uninterpreted to the DBMS interface library, I'd answer this
question with yes.

[...]

> At some point it probably would be better to abstract out the round
> robin code so all SQL drivers could use the same common code for it.

The first hope I had for this was that just creating a virtual driver
which forwards queries to n 'real drivers' would be
sufficient. Ideally, there would be an abstract query queueing and
scheduling layer which passes queries to 'database connection objects'
of some kind, possibly even referring to different kinds of databases.
But this would require a wholesale replacement of all existing drivers
and I am already happy that I was allowed to work a whole ten (nine,
actually) days on this ...


More information about the dovecot mailing list