pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alban Hertroys <haramrae@gmail.com>
To: Guyren Howe <guyren@gmail.com>
Cc: Rory Campbell-Lange <rory@campbell-lange.net>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: PG-General Mailing List <pgsql-general@postgresql.org>
Subject: Re: Advice request : simultaneous function/data updates on many databases
Date: Thu, 5 Mar 2020 09:17:41 +0100
Message-ID: <BCA56E26-D00B-46B5-902E-3F6A8B86D7E8@gmail.com> (raw)
In-Reply-To: <E34FAEFC-8F73-4AFF-966B-4E067CC78A34@gmail.com>
References: <20200304220426.GB7232@campbell-lange.net>
	<7ce9074f-0468-1cc8-3337-018b66e56679@aklaver.com>
	<20200304222257.GA11376@campbell-lange.net>
	<42b4d82b-d468-3f9e-c021-c20bcc141245@aklaver.com>
	<20200304223342.GA11628@campbell-lange.net>
	<E34FAEFC-8F73-4AFF-966B-4E067CC78A34@gmail.com>


> On 4 Mar 2020, at 23:42, Guyren Howe <guyren@gmail.com> wrote:
> 
> On Mar 4, 2020, at 14:33 , Rory Campbell-Lange <rory@campbell-lange.net> wrote:
>> 
>> Essentially we wish to reduce the window where the frontend and backend
>> aren't synchronised.
>> 
>> If we have (for example) 200 databases which each take 2 seconds to
>> update, a client could be on the wrong frontend code for over 6 minutes.
>> Send each of the servers a PL/PGSQL method that executes all the things in a transaction and then waits until the same clock time to commit. Then all the servers are committing at the same moment. They will still be out of synch somewhat, but this would reduce the degree.


I’m wondering whether this could be done with a more generic event-based approach, where each server sends a ‘done’ event to a central machine once it’s ready to commit, and the central machine returns an ‘acknowledged’ once the last server sent it’s ‘done’ event.
The challenge there is that the ‘ack’ needs to be caught and processed within the same waiting transaction… Not sure how to do that right now - maybe through web services, MQTT or similar.

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.






view thread (18+ messages)  latest in thread

Message-ID: <BCA56E26-D00B-46B5-902E-3F6A8B86D7E8@gmail.com>
Permalink:  ../BCA56E26-D00B-46B5-902E-3F6A8B86D7E8@gmail.com/
Also on:    postgresql.org/message-id/BCA56E26-D00B-46B5-902E-3F6A8B86D7E8@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: haramrae@gmail.com, guyren@gmail.com, rory@campbell-lange.net, adrian.klaver@aklaver.com
  Subject: Re: Advice request : simultaneous function/data updates on many databases
  In-Reply-To: <BCA56E26-D00B-46B5-902E-3F6A8B86D7E8@gmail.com>
  References: <20200304220426.GB7232@campbell-lange.net> <7ce9074f-0468-1cc8-3337-018b66e56679@aklaver.com> <20200304222257.GA11376@campbell-lange.net> <42b4d82b-d468-3f9e-c021-c20bcc141245@aklaver.com> <20200304223342.GA11628@campbell-lange.net> <E34FAEFC-8F73-4AFF-966B-4E067CC78A34@gmail.com> <BCA56E26-D00B-46B5-902E-3F6A8B86D7E8@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox