> reusing connections to databases
pgBouncer and ProxySQL are going to give you a better bang for the buck than a stateful web app will.
pgBouncer and ProxySQL are going to give you a better bang for the buck than a stateful web app will.
You can have an awful implementation of a connection pooler, sure, but opening an authenticated socket is more expensive by far than just referencing one.
Less so for a unix socket/named pipe- but still much slower than a memory lookup.
Of course you probably don’t care until you hit a certain scale or number of backend system accesses.
I'm not arguing for a truly stateful webapp, but the connecting pooling you get for free (or some library wrangling) with a long-lived process does a lot for performance and scalability.