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 1j9lhi-0004kc-7k for pgsql-general@arkaria.postgresql.org; Thu, 05 Mar 2020 08:18:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j9lhf-0001e8-67 for pgsql-general@arkaria.postgresql.org; Thu, 05 Mar 2020 08:17:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j9lhe-0001e0-KG for pgsql-general@lists.postgresql.org; Thu, 05 Mar 2020 08:17:58 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j9lhX-00052o-MA for pgsql-general@postgresql.org; Thu, 05 Mar 2020 08:17:57 +0000 Received: by mail-wr1-x42e.google.com with SMTP id v2so5805488wrp.12 for ; Thu, 05 Mar 2020 00:17:51 -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 :content-transfer-encoding:message-id:references:to; bh=/k6cOT2ByJmwyyyE2KxT771dsknlB1GrpGvoZzPdmN8=; b=lHqeBMMlcFMco00e4wz9qowzk7XoWmEFgLoct4IPbCsS91oxtwjJatKk/HDpBH9tjj 3mTnWEp0Q0S/lgtmpIMISxB4KnUSgykjcl19niq2AtUCNhQo34M3JwSfWGY0rkIXg0os 3XtG9MXG1Ir4BroS8SoYioYBXK+5NK9N0J08DTI+ElqNzu4f+9bO+xqGHa29rTz5JmdK n9qUsuQ7+iX8vzEuckxHIssMb66pWA7gnqou+ArPg9Fya13n7kEBZ15MGZblND29DO0G Jd4silMmR+9sn/hyY7itnhBvxaX7GEBZ5cm6NKoWum36TTNd/KoOZqSXcWBYqru0ehmI uKVg== 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 :content-transfer-encoding:message-id:references:to; bh=/k6cOT2ByJmwyyyE2KxT771dsknlB1GrpGvoZzPdmN8=; b=ZFXjplwjFfQHJaVp5JX+4QM0UCDyfVUN50KnQUAqHjxgeDvpgHjOEv61po1Bir9goH 7rvRpf6C5HqUKKzfrk5f6LdfQ300BD27M96kqcPYnoXX3Pcx4ur+iGOx+mxamCWfBEwz sfddZtJa4gbTS2oUWk3mF9FUwVk/8Hyvz9rwvECurErLO52vcR7IAd/AN6KDtkI3PF21 EESzCgs4ZQDd/RQkzcDJjW2lu+6wzOTZVs47bxb1HPBUp6DxkbZzUEx3MjUv64RdK0Zj UbHocEgpfMXLl2en8TNUdlvK4IyPMUGy4aGe9uhH6hV56GqMo1uic5Nn6irZUPwVn3A5 OMVA== X-Gm-Message-State: ANhLgQ18enJTOZFaooKG3WpkZMpTAW/scqegOBAlWQ0W58Vub2WGywD0 67OkpK0ThOk/wSnQhuKK3ZgYrxMT X-Google-Smtp-Source: ADFU+vtinwPMKWjZhC6NNwLgXXZge8fcbWkpXRCXqsolakNYa3GfTbBfb33Sf4SE24TUnMGMynuhAA== X-Received: by 2002:adf:ea42:: with SMTP id j2mr8462472wrn.377.1583396266116; Thu, 05 Mar 2020 00:17:46 -0800 (PST) Received: from hollewijn.internal (217-19-30-105.dsl.cambrium.nl. [217.19.30.105]) by smtp.gmail.com with ESMTPSA id c26sm7991841wmb.8.2020.03.05.00.17.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Mar 2020 00:17:45 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: Advice request : simultaneous function/data updates on many databases From: Alban Hertroys In-Reply-To: Date: Thu, 5 Mar 2020 09:17:41 +0100 Cc: Rory Campbell-Lange , Adrian Klaver , PG-General Mailing List Content-Transfer-Encoding: quoted-printable 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: Guyren Howe X-Mailer: Apple Mail (2.3445.104.11) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On 4 Mar 2020, at 23:42, Guyren Howe wrote: >=20 > 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. I=E2=80=99m wondering whether this could be done with a more generic = event-based approach, where each server sends a =E2=80=98done=E2=80=99 = event to a central machine once it=E2=80=99s ready to commit, and the = central machine returns an =E2=80=98acknowledged=E2=80=99 once the last = server sent it=E2=80=99s =E2=80=98done=E2=80=99 event. The challenge there is that the =E2=80=98ack=E2=80=99 needs to be caught = and processed within the same waiting transaction=E2=80=A6 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.