Oddbean new post about | logout
 In a Postgres connection pool, the connections are fungible. In a Nostr relay pool, the connections are non-fungible. 
 Libraries like generic-pool only work for fungible connection pool. https://www.npmjs.com/package/generic-pool 

 
 @fiatjaf new Nostr theory just dropped 
 This is true and so far in history all people who have used WebSockets were retarded, that's why they made libraries like "persistent-websocket" and other garbage. 
 What is a nostr relay pool?  Are you saying multiple connections to the same relay are not fungible because of the AUTH state? 
 Non fungible because different relays are used for different purposes, they're not purely interchangeable 
 Two different postgres databases aren't interchangeable either. I woudn't compare a postgres connection pool to a set of connections to multiple relays, I'd compare it to a set of connections to the same relay.  Of course if you think of multiple relays as comprising one distributed database then I see how you could think of it otherwise, but it is what it is. 
 They also can't be naïvely dropped and restarted since you lose all the open subscriptions.

I guess instead of non-fungible the correct name would be "stateful".