Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1j9cib-0001zE-2z for pgsql-general@arkaria.postgresql.org; Wed, 04 Mar 2020 22:42:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j9ciZ-0000p5-Uf for pgsql-general@arkaria.postgresql.org; Wed, 04 Mar 2020 22:42:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j9ciZ-0000oy-Ky for pgsql-general@lists.postgresql.org; Wed, 04 Mar 2020 22:42:19 +0000 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j9ciW-0001JR-FI for pgsql-general@postgresql.org; Wed, 04 Mar 2020 22:42:18 +0000 Received: by mail-pg1-x52e.google.com with SMTP id n24so701813pgk.11 for ; Wed, 04 Mar 2020 14:42:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc:message-id:references :to; bh=kVm88mB0AmM6crfamVUE7V80Yso6m1/ce/bjlseMDBo=; b=f1CkZ/fC5cd0GyJY56Bsn/xm49ih5O9kvekj3GkLkSR76vKegVPaGdF7QMiUcNmv0z EbmT02qCp4eQHQI86g0WMcSqAuavvuksHVTIo2em36iCvz0gloGm9cy8C9x5UsypQS8Z vP9+6nw+DwNkTj/QLnsRdzpd1qW5zVUWHbqQ5Rfgh73VKNqxPCxId5isd6VAumZK82l/ NEIFCwoq3OdZg6geP0XFmAh7iEfRVljC9Eql/t4GU2GCzPwgjnnfFKLsIH3SMUb3OC9F krstbeZygChoHA7H+swUKoUO6FktBnqWwSajmFgC0eCkC/CDL9B7fTfWZAYCM6ervx/o fuJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=kVm88mB0AmM6crfamVUE7V80Yso6m1/ce/bjlseMDBo=; b=IyZzXrmtqtU+fYCMhvK9+UbGOIK5gCvGYR5U51445RytbrEMl8BaDE4nQMqbHzmSm5 1/8SsA3So8nJQ65x4lKKPKSF5g9Ec4P9suCeOx2eAYpG9QDgASDPp+Z/l+QtDMS/XvoD XVrpul4Ewwao59VLMnfqM7NBzd7D3EeyOk5nZCdgPb+SIVx4/7wTt2kKkVds7wOc00Fh 6shNQCTA0mS1z0t0fm6LXlp2JNlqttj73FyK08OjTRM4NAiZo874Sbx8rOCcr9m6IZXF gE00EUXCfAkn/VRf9sVbJ0XBxQPRpef3/ds2dtxhxYo2krmg4oC9uypyT0CPidE6pUv+ YrAg== X-Gm-Message-State: ANhLgQ2Lpaqj7NhMHyfAZ9fiyndsXZwuAJ7L1y0a6PXi7MdjBvVFa+2i UUzCVmruRB74ny/cw/FCViM= X-Google-Smtp-Source: ADFU+vuuIXeNeEE+0uYnycgnJ9FvQriE9XGIrAWhTknJfNbashIbmrZm2G0ioSI6XrH63zueoSHUSQ== X-Received: by 2002:a62:ed19:: with SMTP id u25mr5271355pfh.173.1583361733835; Wed, 04 Mar 2020 14:42:13 -0800 (PST) Received: from ?IPv6:2600:8801:8800:195::1b? ([2600:8801:8800:195::1b]) by smtp.gmail.com with ESMTPSA id u12sm23460683pgh.52.2020.03.04.14.42.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Mar 2020 14:42:13 -0800 (PST) Content-Type: multipart/alternative; boundary="Apple-Mail=_39497C96-E76E-4A53-9336-B7F8C6B8CC05" Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: Advice request : simultaneous function/data updates on many databases From: Guyren Howe In-Reply-To: <20200304223342.GA11628@campbell-lange.net> Date: Wed, 4 Mar 2020 14:42:01 -0800 Cc: Adrian Klaver , PG-General Mailing List X-Mailbutler-Message-Id: 2A13A29D-60BD-4B76-8873-4AC2D0ED5039 Message-Id: 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> To: Rory Campbell-Lange X-Mailer: Apple Mail (2.3608.60.0.2.5) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_39497C96-E76E-4A53-9336-B7F8C6B8CC05 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Mar 4, 2020, at 14:33 , Rory Campbell-Lange = wrote: >=20 > Essentially we wish to reduce the window where the frontend and = backend > aren't synchronised. >=20 > 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. --Apple-Mail=_39497C96-E76E-4A53-9336-B7F8C6B8CC05 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii 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.
3D""= --Apple-Mail=_39497C96-E76E-4A53-9336-B7F8C6B8CC05--