Published by jonah.harris at 6:41 am under General , Internals , Open Source , SQL , Tools
So, a few people have asked me what NEXTGRES Gateway is. My short answer, the ultimate database compatibility server.
Sorry if this blog entry sounds very marketing-oriented, but I’ve been working on this personal project non-stop for the last 8 months and am really excited about it.
NEXTGRES Gateway in a nutshell:
In this entry, I’m going to focus on MySQL server emulation.
Now that I’ve fully completed the MySQL server emulation component, something I discussed with the Oracle Data Access guys at OpenWorld, here’s a couple examples for you.
Say you have an application that runs on MySQL and you’d like to migrate it to Postgres, but don’t want to do any code changes. Well, if you’re using fairly standard ODBC/JDBC, you don’t have much to worry about. But what if it’s a PHP application using the mysql_* calls, or an application using the MySQL client libraries, or a third-party application you don’t have the code for? The answer is to use NEXTGRES Gateway.
NEXTGRES Gateway allows you migrate your data to another database transparently to the application. The general process for using NEXTGRES Gateway is as follows:
Unlike other databases which claim to be compatible, NEXTGRES Gateway allows you to migrate an application to another database server with no application changes.
In the following example, I’m using the native MySQL client to connect to a PostgreSQL 8.3 database. It’s important to note that no changes have been made to the MySQL client , it’s just connecting to NEXTGRES Gateway which is emulating the MySQL server by performing SQL syntax and protocol translation to Postgres.
jharris@jharris-desktop$ mysql -A -u root -h 127.0.0.1 pgdb Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.1.39 (NEXTGRES Gateway 4.2.0.1) Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement. mysql> select count(*) from pg_tables; +——-+ | count | +——-+ | 51 | +——-+ 1 row in set (0.01 sec) mysql> select tablename from pg_tables limit 5; +————————-+ | tablename | +————————-+ | sql_features | | sql_implementation_info | | pg_statistic | | sql_languages | | sql_packages | +————————-+ 5 rows in set (0.01 sec)
That’s cool and all, but say we want to move our MySQL application to Oracle:
jharris@jharris-desktop$ mysql -A -u root -h 127.0.0.1 oradb Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.1.39 (NEXTGRES Gateway 4.2.0.1) Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement. mysql> select count(*) from all_tables; +———-+ | COUNT(*) | +———-+ | 108 | +———-+ 1 row in set (0.03 sec) mysql> select count(*) from user_tables; +———-+ | COUNT(*) | +———-+ | 9 | +———-+ 1 row in set (0.01 sec) mysql> select user from dual; +———–+ | USER | +———–+ | AUTOGRAPH | +———–+ 1 row in set (0.01 sec) mysql> select table_name from all_tables limit 5; +———————–+ | TABLE_NAME | +———————–+ | DUAL | | SYSTEM_PRIVILEGE_MAP | | TABLE_PRIVILEGE_MAP | | STMT_AUDIT_OPTION_MAP | | AUDIT_ACTIONS | +———————–+ 5 rows in set (0.02 sec)
For those that didn’t catch it, NEXTGRES Gateway performed a simple SQL translation from MySQL to Oracle syntax on:
SELECT table_name FROM all_tables LIMIT 5;
SELECT table_name FROM all_tables WHERE ROWNUM < 6;
If you want to see more, I’ll be happy to demonstrate MySQL, Postgres, and Oracle emulation at the Southeastern Oracle Users Conference , February 24 & 25 in Charlotte, North Carolina. I’ll also be presenting my session, “Listening In: Passive Capture and Analysis of Oracle Network Traffic”. This session is designed to help you diagnose issues with and optimize applications for, the Oracle network protocol.
2 Responses to “NEXTGRES Gateway: MySQL Emulator for Oracle”
Leave a Reply
You must be logged in to post a comment.