# XtraDB Cluster+HAProxy

**URL:** <https://forums.percona.com/t/xtradb-cluster-haproxy/2452>\
**Category:** Percona XtraDB Cluster 5.x\
**Created:** [July 26, 2012, 1:23pm UTC](https://forums.percona.com/t/xtradb-cluster-haproxy/2452 "2012-07-26T13:23:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sank](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@sank](https://forums.percona.com/u/sank)\
**Post date:** [July 26, 2012, 1:23pm UTC](https://forums.percona.com/t/xtradb-cluster-haproxy/2452/1 "2012-07-26T13:23:39Z")

</div>

What method should be used to separate read vs write traffic for xtradb cluster with HAProxy setup. Is it ok to introduce mysql-proxy in this setup ?

---

<div class="post-metadata">

**Author:** ![dorogoy](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@dorogoy](https://forums.percona.com/u/dorogoy)\
**Post date:** [August 3, 2012, 11:15am UTC](https://forums.percona.com/t/xtradb-cluster-haproxy/2452/2 "2012-08-03T11:15:55Z")

</div>

You are using Percona XtraDB Cluster so why do you want to separate read and write?  
XtraDB Cluster and HAProxy are an amazing combination.

---

<div class="post-metadata">

**Author:** ![bdbell](https://avatars.discourse-cdn.com/v4/letter/b/34f0e0/32.png) [@bdbell](https://forums.percona.com/u/bdbell)\
**Post date:** [August 3, 2012, 2:03pm UTC](https://forums.percona.com/t/xtradb-cluster-haproxy/2452/3 "2012-08-03T14:03:18Z")

</div>

Based on the example ha-proxy configuration, I could see the usage to send writes to the single-host mode (example port 3306) and reads to the entire cluster (example port 3307). Then the cluster behavior is transparent to the original application and still somewhat optimized.
