I stumbled upon
MySQL Proxy today. It's in Alpha stages right now, but it looks like it's going to be great. Thanks to the
keepalived project we have been able to load balance and fail over MySQL read queries for a long time now.
But this software has some cool new features:
- Query Analysis
- Query Filtering
- Query Modification
And they've even built in support for the
Lua language. I first heard of Lua from
Lighty and I'm even more fascinated now that MySQL Proxy has support for it too. Basically, you can add hooks at any of these stages:
- connect_server
- read_query
- read_query_result
to modify, rewrite, track, or do practically anything you want. Awesome stuff.
Here are some example scripts.