If you want haproxy to load balance across your databases and do so by some value in the traffic, you'll need to expose your database via a protocol that haproxy supports.
Write an RPC service that speaks HTTP and have haproxy load balance across your RPC servers using HTTP values. This is pretty common practice IMHO. On Tue, Aug 17, 2010 at 2:16 PM, Turlapati, Sreenivasa <[email protected]> wrote: > Thxs a lot. > > Sorry, if I am misguiding you. > > I am just curious to know, when HAProxy is set at TCP mode, we want to > scan or glance over the incoming request for a particular string say > 'XYZ'. If the incoming request contains the 'XYZ' string, route the > request to a backend xyz group else route to backend 'ABC' group. > > Thank You, > Sreeni T > Work : +1 781-302-6143 > Cell : +1 617-955-3736 > [email protected] > > -----Original Message----- > From: Willy Tarreau [mailto:[email protected]] > Sent: Tuesday, August 17, 2010 4:16 PM > To: Turlapati, Sreenivasa > Cc: [email protected] > Subject: Re: 'haproxy' in AIX OS for C++ Applications > > On Tue, Aug 17, 2010 at 03:50:19PM -0400, Turlapati, Sreenivasa wrote: >> Hi, >> >> We are not trying to use sql proxy, indeed we are using the TCP proxy. >> >> Just we need to read the incoming request and based on the sql file > name >> we need to route the request to a backend server. We doesn't need to >> bother what the sql file got and how to execute it, we need to care >> which group we need to route the request. > > I understand what you want to do, but you have to understand that > "the sql file name" designates something which does not exist at the TCP > level. This means that an SQL parser is required to be able to extract > that > from the requests, and in my opinion the best way to find one is to > check > an SQL proxy. > > Regards, > Willy > > >

