At MySQL I'm writing several different command-line applications from the MEMo Agent to the MySQL Proxy. They all have a common set of requirement:
- command-line options
- config-files (mapping cmd-line options to config-files)
- logfile handling (syslog, SIGHUP, ...)
- a mainloop (SIGINT, CtrlHandler, ...)
- daemonizing (daemonize, services, ...)
- plugin handling
In the proxy svn you see all this a the chassis of
the proxy.
At the side it has a MySQL-Server and a MySQL-Client (we usually call it the proxy). Currently this is implemented as libmysql-proxy which is then used by the proxy plugin to implement the proxy.
By splitting up the design into 3 different layers:
- chassis
- low-level protocol + protocol states
- proxy implementation as plugin
we can
- use the …