# Best practice for percona cluster to connect with the app

**URL:** <https://forums.percona.com/t/best-practice-for-percona-cluster-to-connect-with-the-app/21054>\
**Category:** Percona XtraDB Cluster 5.x\
**Tags:** mysql, percona\
**Created:** [March 30, 2023, 8:42am UTC](https://forums.percona.com/t/best-practice-for-percona-cluster-to-connect-with-the-app/21054 "2023-03-30T08:42:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RSub](https://avatars.discourse-cdn.com/v4/letter/r/a8b319/32.png) [@RSub](https://forums.percona.com/u/RSub)\
**Post date:** [March 30, 2023, 8:42am UTC](https://forums.percona.com/t/best-practice-for-percona-cluster-to-connect-with-the-app/21054/1 "2023-03-30T08:42:54Z")

</div>

Hello all,

I have a percona cluster of 3 and I am also using ProxySQL for monitoring the clusters. My apps are connecting to one of the cluster nodes which was bootstrapped and the data gets written to all the other nodes because I have write enabled to all three nodes. Should I connect the apps to ProxySQL instead of connecting to one of the node in the cluster? If I do that if my ProxySQL goes down my cluster will stop working.  
Please let me know what will be the best practice.

Thanks,  
Rushita

---

<div class="post-metadata">

**Author:** ![Ivan\_Groenewold](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ivan_groenewold/32/6299_2.png) [@Ivan\_Groenewold](https://forums.percona.com/u/Ivan_Groenewold)\
**Post date:** [March 30, 2023, 10:59am UTC](https://forums.percona.com/t/best-practice-for-percona-cluster-to-connect-with-the-app/21054/2 "2023-03-30T10:59:16Z")

</div>

Hi, you should connect via proxysql since you implemented it. Either install it locally on every app server or set up a a few instances behind a load balancer. Here are some examples of the latter: [Consul, ProxySQL and MySQL HA](https://www.percona.com/blog/consul-proxysql-mysql-ha/)

---

<div class="post-metadata">

**Author:** ![RSub](https://avatars.discourse-cdn.com/v4/letter/r/a8b319/32.png) [@RSub](https://forums.percona.com/u/RSub)\
**Post date:** [March 30, 2023, 3:04pm UTC](https://forums.percona.com/t/best-practice-for-percona-cluster-to-connect-with-the-app/21054/3 "2023-03-30T15:04:06Z")

</div>

Hello Ivan, thank you for the response. I have installed proxysql in a separate server. what should I be doing in this case?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [March 31, 2023, 4:26pm UTC](https://forums.percona.com/t/best-practice-for-percona-cluster-to-connect-with-the-app/21054/4 "2023-03-31T16:26:23Z")

</div>

@RSub Since you have proxysql installed, your applications should now be connecting to proxysql, not the cluster. All traffic will now go like this “app → proxysql → backend pxc”
