Is it good for applying connection pool on both application and proxy tier?

67 Views Asked by At

I'm having a Galera Mysql cluster and ProxySQL on top of this cluster. ProxySQL has connection pool mechanism itself.

My question is, should I apply connection pool on application (.net, springboot,...) along with ProxySQL's connection pool ? And what is the recommendation for this ?

Thank you.

1

There are 1 best solutions below

4
Kiki odazie On

Depends on your application architecture (monolith or Microservices) and the number of databases servers you have. From my experience you don't need too.

ProxySQL opens a pool of connections to the backend servers. It is not 1-to-1 mapping, by default it tries to reuse one backend connection for as many frontend connections as possible. This is called connection multiplexing.

ProxySQL can handle N frontend connections and M backend connections, where N > M (even N thousands times bigger than M).

You can refer to this old conversation by ProxySQL creator or its documentation on multiplexing.

Also, check out this article on connection handling & throttling with ProxySQL. (Disclosure: I am affiliated with this site.)