Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tAVOq-00G7FK-Cu for pgsql-general@arkaria.postgresql.org; Mon, 11 Nov 2024 14:28:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tAVOn-00Es69-2D for pgsql-general@arkaria.postgresql.org; Mon, 11 Nov 2024 14:28:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tAVOm-00Es61-Le for pgsql-general@lists.postgresql.org; Mon, 11 Nov 2024 14:28:13 +0000 Received: from mail-il1-x12d.google.com ([2607:f8b0:4864:20::12d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tAVOj-001N5u-5x for pgsql-general@postgresql.org; Mon, 11 Nov 2024 14:28:12 +0000 Received: by mail-il1-x12d.google.com with SMTP id e9e14a558f8ab-3a3f8543f5eso15658535ab.0 for ; Mon, 11 Nov 2024 06:28:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731335288; x=1731940088; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=MuV7I9O0k4ZRMfBBYbG3vKGHTkLUtV/1tqmTtMoWkUc=; b=Mndvp4gcX5EkSqts6nh9yyBNksSQV4bIrvbDSvWCdhbF5RIJrg4ApOaBnq1ENe+mba +/dlpi+QTaSPk/pAOO3lowO6EiOFmN+lJPYcTh/HrNHIjbBKed35LwHSmS9F5P3TeAXC fDmjCW+NSfSj7bMuPnP7cj1P0pqZ8ezBbmRUVyqmiiOCbQGjPjcG4vZnMghPcAT5YIaU CyHwSqkVrp18iATPvLsJi1pqS6sNHNuCD1Q77oMTQ00dejJBusRBDHwLFTIUamdj9ztP LMnEOwrkT/vK8qwxyIDUOD66xQMyu6W0163nlW+zL2u6B2U27fuyRMSJQ25j2yFcBKpz r9cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731335288; x=1731940088; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MuV7I9O0k4ZRMfBBYbG3vKGHTkLUtV/1tqmTtMoWkUc=; b=JA/Qqz+qQ+vToXUZAW8QtCGbNNjcqVfiWRoEFAXLqUzF07uytg4pTfFqUHjNxXz+Nz K7+0zKgTJ5FHkvOI41nwA4Z0IrYKf8vYIvHfuz+h3PwFd0giFrAqK33vqQlmdsTRZnV0 gVDMcAUKJlZpxyq7niUM9iemMMwXVMOBLQReG563jMZxtKmOULpgw2xys6L2pFu1ifB9 vBsfPXtxrBo8UIZ71pflSpwjAxbJeZS/44fYTQ0va/uGP6TUB5NyNF8XGqSKlSGH6JC+ iWn88D3dMJxcl2g6pal9E/KmgzMsEKDWz+FA1fHbo81mdl4dq3TG9exuUM/Wk1TCUDMl 3iRA== X-Gm-Message-State: AOJu0YxzGn5/McPxfQUDioXGd4bv5bGl7tNupOKP7X8dL/gF5b7h5JHM PCQx/3aOYPn117H5qSF4pMNixPBRACDOuwYjgzZWquVB7z4y6LZ0XsA7Yp340QGb8mxQ70HKKQL wNK39+Alww1LwRF/UyhwQOscx0W8kceuQbp4= X-Google-Smtp-Source: AGHT+IFSg9et8bFPjbg8CInCeOyzE2uqHmYS7Unh5nH8DfIwzE56TGQclXgsuhAUaGWfAN1mkuaywGh4QVKVwKTTPJk= X-Received: by 2002:a05:6e02:238a:b0:3a6:b26f:a5c4 with SMTP id e9e14a558f8ab-3a6f253470amr112142305ab.8.1731335288127; Mon, 11 Nov 2024 06:28:08 -0800 (PST) MIME-Version: 1.0 References: <897B047D-B99D-4637-ACBD-E98EC3D38DD5@leisi.net> In-Reply-To: <897B047D-B99D-4637-ACBD-E98EC3D38DD5@leisi.net> From: Greg Sabino Mullane Date: Mon, 11 Nov 2024 09:27:33 -0500 Message-ID: Subject: Re: Advice on cluster architecture for two related, but distinct, use cases To: Matthias Leisi Cc: pgsql-general@postgresql.org Content-Type: multipart/alternative; boundary="000000000000d609d00626a3e881" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d609d00626a3e881 Content-Type: text/plain; charset="UTF-8" Some of those requirements are vague, but yes, Patroni should probably be the first approach you look at. If the second datacenter is just for redundancy, then a simple setup would be: DCA (data center A): Postgres server 1 Postgres server 2 DCB: Postgres server 3 (set no_failover: true) You will also need a DCS system of some sort (e.g. etcd on all three nodes), as well as a backup system (e.g. pgBackRest). Will also need to decide how automated you want things to be (for example, cross datacenter failover in the above would be manually done). It should definitely be able to handle your RPO/RTO requirements easily enough. [Patroni] However it seems relatively complex to set up and operate Setting things up can be a little complex, yes, but once done it just works, so very little operation resources are needed. We can not assume eg a load balancer. Possible via the application: see https://www.postgresql.org/docs/current/libpq-connect.html (esp. target_session_attrs) Cheers, Greg --000000000000d609d00626a3e881 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Some of those requirements are vague= , but yes, Patroni should probably be the first approach you look at. If th= e second datacenter is just for redundancy, then a simple setup would be:

DCA (data center A):
Postgres server 1
Postgres server 2

DCB:
Postgres = server 3 (set no_failover: true)

You will also nee= d a DCS system of some sort (e.g. etcd on all three nodes), as well as a ba= ckup system (e.g. pgBackRest). Will also need to decide how automated you w= ant things to be (for example, cross datacenter failover in the above would= be manually done). It should definitely be able to handle your RPO/RTO req= uirements easily enough.

[Patroni] However it seems relatively complex to set up= and operate

Setting things up can be a lit= tle complex, yes, but once done it just works, so very little operation res= ources are needed.=C2=A0

We can not assume eg a load balancer.
=
Possible via the application: see=C2=A0https://www.postgresql.or= g/docs/current/libpq-connect.html (esp. target_session_attrs)

Cheers,
Greg

--000000000000d609d00626a3e881--