pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Dominique Devienne <ddevienne@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Using PostgreSQL for service discovery and health-check
Date: Thu, 9 Feb 2023 08:51:13 -0800
Message-ID: <eea6ff37-a174-deac-11b4-8a590fedbdc9@aklaver.com> (raw)
In-Reply-To: <CAFCRh--5bphNNK2VV6icO37OnY0tZ2rTqTroJEr8LqabjUxBcQ@mail.gmail.com>
References: <CAFCRh-9okm64gEM-Oy27Lh-2k=PKEBbK1C5cG1vgwEjgN-EB+w@mail.gmail.com>
	<a7bc901a-a191-9504-c5be-41de7128c5b9@aklaver.com>
	<CAFCRh--5bphNNK2VV6icO37OnY0tZ2rTqTroJEr8LqabjUxBcQ@mail.gmail.com>

On 2/9/23 08:16, Dominique Devienne wrote:
> On Thu, Feb 9, 2023 at 5:05 PM Adrian Klaver <adrian.klaver@aklaver.com 
> <mailto:adrian.klaver@aklaver.com>> wrote:
> 

>     Is there more then one server providing the same service?
> 
> 
> Yes. That was my PS: basically. The client can connect to any one, randomly.
> We need at least one of course. But there could me more than 1, yes.

>     Would it no be easier to not have random ports and just attempt
>     connections to the servers either:
>     1) In the client with reattempt to different port on failure.
>     2) From Postgres server and update table to have current up servers.
> 
> 
> I'm sorry, but I'm not following. Can you perhaps rephrase?
> 
> Regarding ports, once you have registration of services, just seems 
> easier to me to NOT have a fixed port,
> and let the host assign any port to the HTTP server. Those servers are 
> not user-facing directly, from the client
> side, it calls an API and lookup of the service and connection to the 
> HTTP server is transparent is an implementation
> detail, so the port used doesn't matter. In-DB registration of (HTTP) 
> servers makes the while URL an implementation detail.

The flip side of that is that with known ports it would it easier to 
have a process on the Postgres machine or in the database that checks 
the ports on regular basis. And as part of that process mark any non 
responding ports as inactive. That would solve the zombie problem.

-- 
Adrian Klaver
adrian.klaver@aklaver.com






view thread (9+ messages)  latest in thread

Message-ID: <eea6ff37-a174-deac-11b4-8a590fedbdc9@aklaver.com>
Permalink:  ../eea6ff37-a174-deac-11b4-8a590fedbdc9@aklaver.com/
Also on:    postgresql.org/message-id/eea6ff37-a174-deac-11b4-8a590fedbdc9@aklaver.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: adrian.klaver@aklaver.com, ddevienne@gmail.com
  Subject: Re: Using PostgreSQL for service discovery and health-check
  In-Reply-To: <eea6ff37-a174-deac-11b4-8a590fedbdc9@aklaver.com>
  References: <CAFCRh-9okm64gEM-Oy27Lh-2k=PKEBbK1C5cG1vgwEjgN-EB+w@mail.gmail.com> <a7bc901a-a191-9504-c5be-41de7128c5b9@aklaver.com> <CAFCRh--5bphNNK2VV6icO37OnY0tZ2rTqTroJEr8LqabjUxBcQ@mail.gmail.com> <eea6ff37-a174-deac-11b4-8a590fedbdc9@aklaver.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