MySQL Forums
Forum List  »  Perl

DBIx::MyServer - Perl module that implements MySQL client/server protocol
Posted by: Edwin DeSouza
Date: July 12, 2007 02:50PM

Introducing DBIx::MyServer

Philip Stoev has written DBIx::MyServer, a Perl module that implements MySQL client/server protocol in Perl.

In plain words, this module can act as a server to any mysql client, meaning that it can accept requests and it knows how to send answers back. If your application can negotiate a dialog to a MySQL server, it can also talk to this specific server.

Thus you can use a MySQL client as interface to read file-system directories, list email headers, get contents from the web, browse Perl data structures. You name it. Anything you could do in Perl you could see through a MySQL interface.

Of course, the server would not be of much usage if it could not act as a man-in-the-middle (or, more appropriately, server-in-the-middle), i.e get a query from a client, pass it to the server, get the results from the server, return them to the client. And what is the advantage, you may ask, other than delaying the data a few microseconds?

The main advantage is that the proxy server can manipulate the query before sending it to the server, and eventually it can modify the results before sending them, back to the client.

For example, you can enforce all GRANT queries to have a password, and you can prevent users from setting empty or weak passwords.
Or you can replace the contents of the 'password' column, so that it will be shown as a string of asterisks.

Since the server is written in Perl, and it's object oriented, adding a feature by sub-classing the server class takes just a few minutes. Implementing a set of macros or just a whole new language with relative features is just plainly easy.

Moreover, since Perl, through the DBI, can connect to any database server, new horizons open for you. You can use any database server as data source for a MySQL Federated table. In other words, you can use a PostgreSQL/Oracle/SQl Server/SQLite table, and a MySQL table in the same query, from a MySQL client, which will see them as normal tables.

Science fiction? Not at all. It's doable now!

more:
http://dev.mysql.com/tech-resources/articles/dbixmyserver.html



Edited 1 time(s). Last edit at 07/12/2007 02:52PM by Edwin DeSouza.

Options: ReplyQuote


Subject
Written By
Posted
DBIx::MyServer - Perl module that implements MySQL client/server protocol
July 12, 2007 02:50PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.