← Back to team overview

mysql-proxy-discuss team mailing list archive

Re: Mysql Proxy UseCase scenario question

 

Hi!

On Feb 6, 2009, at 12:22 AM, zoly farkas wrote:

I have a set of mysql servers with identical schemas, but with different data, that I want to access as one database.

I would like the backend database to be selected by something provided in the sql query like a hint, or a where clause (or something else) where I will provide the server name or ip of the backend.

I cannot resolve this at application level because I have no control of the application (a reporting tool).

Does it make sense to use mysqlproxy for this purpose?


Totally, in fact it was designed for such a thing.
The hard part currently is to be able to reliably tell those queries apart (we don't yet have a full parser).

You could even use the tokenizer we ship and build a simplistic parser by hand or, if you are truly lucky, get by with some string matching (regexes, lpegs or substring matching) to pick the backend to go to.

It is kinda hard to give specific advice without seeing some sample queries, though.

cheers,
-k
--
Kay Roepke
Software Engineer, MySQL Enterprise Tools

Sun Microsystems GmbH    Sonnenallee 1, DE-85551 Kirchheim-Heimstetten
Geschaeftsfuehrer: Thomas Schroeder, Wolfang Engels, Dr. Roland Boemer
Vorsitz d. Aufs.rat.: Martin Haering                    HRB MUC 161028




Follow ups

References