Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
MySQL Compatible Open  Source Connectors  Andrew (LinuxJedi) Hutchings  Master Software Engineer - HP
Who am I?●   Worked at Sun/Oracle on MySQL 2008-2010●   Worked at Rackspace on Drizzle 2010-2011●   Worked at SkySQL on My...
Why this talk?● I work for HP Cloud● MySQL and its forks are the database for the  cloud● I currently work on a MySQL conn...
LicensesNotes:● I am not a lawyer● These legal views are my own and not  necessarily HPs  ○ They may not even be correct, ...
GPL v2●   General Public License●   Compatible with most Open Source licenses●   Not compatible with commercial licenses● ...
FLOSS ExceptionFree/Libre Open Source Software Exceptions● Allows GPL library to be linked to a non-  compatible Open Sour...
LGPL v2● Lesser (or Library) General Public License● Allows dynamic linking with other licenses● Doesnt allow static linki...
BSD Simplified● AKA BSD New or 3-Clause BSD● Can link to commercial software● Very liberal simple license
MIT● Even more liberal than BSD● Very simple license
Apache 2.0● Can link to commercial software● Includes patent usage grants● License text is around 5x longer than BSDs
PHP v3.01● Not compatible with GPL license● Can link with commercial software
License Compatibility                                                                            Library                  ...
Frameworks● Only linking to framework  ○ So connector license not a problem  ○ Connector is loaded on-demand by the framew...
Licensing ResourcesTL;DR Legalhttp://www.tldrlegal.com/GPL Compatibility Charthttp://www.gnu.org/licenses/license-list.htm...
C/C++/C# Connectors
Clibmysqlclient●   Developed by Oracle●   Bundled with MySQL●   LGPL licensed up until 3.23.58●   GPL licensed onwards    ...
CConnector/C● Developed by Sun● An attempt to separate out the connector● GPL licensed  ○ Also has commercial license  ○ H...
CMariaDB Client Library● Developed by Monty Program Ab and  SkySQL Ab● A fork of MySQLs 3.23 client library  ○ Also contai...
C/C++Libdrizzle● Developed by Open Source community    ○ Companies such as Sun and Rackspace have been      involved●   C ...
CLibdrizzle Redux● Developed by me● A heavily modified version of Libdrizzle● Still under the Drizzle umbrella    ○ But di...
C API ExampleSetupMySQL APIconn = mysql_init(NULL);mysql_real_connect(conn, "localhost", "user", "passwd","testdb", 0, NUL...
C API ExampleQueryMySQL APImysql_query(conn, "SELECT * FROM t1");result = mysql_store_result(conn);num_fields = mysql_num_...
C++Connector/C++● Developed by Oracle● JDBC 4.0 API compatible  ○ Although only about 80% implemented● GPL licensed  ○ Com...
CConnector/ODBC● Developed by Oracle● GPL Licensed  ○ With FLOSS Exception  ○ Commercial available● Is a plugin for the OD...
C#Connector/NET● Developed by Oracle● GPL Licensed  ○ With FLOSS Exception  ○ Commercial available● Implements ADO.NET int...
PHP Connectors
PHP● Three different connectors   ○ mysql   ○ mysqli   ○ pdo_mysql● All three use either libmysqlclient or  MySQLnd
PHPlibmysqlclient based● PHP cant link to GPL● PHP 3 dual licensed PHP/GPL● PHP 4 onwards licensed PHP only  ○ So couldnt ...
PHPMySQLnd● Developed by Oracle● C based MySQL client library for PHP● Licensed under PHP license
Python Connectors
PythonMySQLdb●   Independently developed●   GPL licensed●   Wraps around libmysqlclient●   Supports Python DB-API 2.0
PythonConnector/Python● Developed by Oracle● GPL licensed  ○ With FLOSS exception  ○ Commercial also available● Native dri...
Python FrameworkSQLAlchemy● MIT licensed● Gets around linking problem● Uses DB-API 2.0 connectors
Java Connectors
JavaConnector/J● Developed by Oracle● GPL Licensed  ○ Also has commercial license  ○ With FLOSS exception● JDBC Type 4 dri...
JavaDrizzle JDBC● Developed by Open Source community  ○ Companies such as Sun and Rackspace have been    involved● BSD Lic...
JavaMariaDB Client Library for Java● Developed by Monty Program Ab and  SkySQL Ab● A fork of Drizzle JDBC● LGPL Licensed● ...
Other Interfaces
Node.js● Many available!  ○ Around 10 projects● node-mysql appears to be most prominent  ○ MIT licensed  ○ Appears to be a...
NoSQL Interface● Developed by Oracle● Included in MySQL 5.6● GPL Licensed  ○ With a commercial version  ○ Unsure about FLO...
MySQL Cluster● NDBAPI & MGMAPI  ○ NoSQL interface● Memcache based NoSQL interface● Java APIs
PluginsPossible to create things like● UDP● HTTP / RESTRead my book to find out more:
Thank you!My work (were hiring!):http://hpcloud.com/Twitter / Freenode IRC nick:LinuxJediEmail:andrew@linuxjedi.co.uk / li...
Upcoming SlideShare
Loading in …5
×

MySQL Compatible Open Source Connectors

4,180 views

Published on

MySQL Compatible Open Source Connectors

Slides for talk at Percona Live London 2012

Published in: Technology
  • Be the first to comment

MySQL Compatible Open Source Connectors

  1. 1. MySQL Compatible Open Source Connectors Andrew (LinuxJedi) Hutchings Master Software Engineer - HP
  2. 2. Who am I?● Worked at Sun/Oracle on MySQL 2008-2010● Worked at Rackspace on Drizzle 2010-2011● Worked at SkySQL on MySQL/Drizzle 2011● Co-author MySQL 5.1 Plugin Development● Now work at HP Cloud on an LBaaS
  3. 3. Why this talk?● I work for HP Cloud● MySQL and its forks are the database for the cloud● I currently work on a MySQL connector in my spare time
  4. 4. LicensesNotes:● I am not a lawyer● These legal views are my own and not necessarily HPs ○ They may not even be correct, my brain has been fried with legalese
  5. 5. GPL v2● General Public License● Compatible with most Open Source licenses● Not compatible with commercial licenses● Must include all source (and tracked changes to library)
  6. 6. FLOSS ExceptionFree/Libre Open Source Software Exceptions● Allows GPL library to be linked to a non- compatible Open Source license without relicensing as GPL● MySQLs built-in client library is covered by this ○ Except maybe a few 5.1 versions
  7. 7. LGPL v2● Lesser (or Library) General Public License● Allows dynamic linking with other licenses● Doesnt allow static linking ○ becomes a derivative work● Must include library source
  8. 8. BSD Simplified● AKA BSD New or 3-Clause BSD● Can link to commercial software● Very liberal simple license
  9. 9. MIT● Even more liberal than BSD● Very simple license
  10. 10. Apache 2.0● Can link to commercial software● Includes patent usage grants● License text is around 5x longer than BSDs
  11. 11. PHP v3.01● Not compatible with GPL license● Can link with commercial software
  12. 12. License Compatibility Library GPL 2 PHP 3.01 Apache 2.0 LGPL 2.0 BSD/MIT GPL (dynamically linked) ✔ ✘* ✔ ✔ ✔Application GPL (statically linked) ✔ ✘* ✔ ✔ ✔ Commercial (dynamically linked) ✘ ✔ ✔ ✔✝ ✔ Commercial (statically linked) ✘ ✔ ✔ ✘ ✔ * Workaround possible with FLOSS exception ✝ Need to provide lib source to end user
  13. 13. Frameworks● Only linking to framework ○ So connector license not a problem ○ Connector is loaded on-demand by the framework ○ Should be good as long as you dont distribute the connector with your application● Examples include ○ ODBC (Open DataBase Connectivity) ○ JDBC (Java DataBase Connectivity) ○ SQLAlchemy (Python)● Most are MIT licensed
  14. 14. Licensing ResourcesTL;DR Legalhttp://www.tldrlegal.com/GPL Compatibility Charthttp://www.gnu.org/licenses/license-list.htmlAsk Monty Licensing FAQhttps://kb.askmonty.org/en/licensing-faq/
  15. 15. C/C++/C# Connectors
  16. 16. Clibmysqlclient● Developed by Oracle● Bundled with MySQL● LGPL licensed up until 3.23.58● GPL licensed onwards ○ Also commercial licensed ○ Has FLOSS Exception
  17. 17. CConnector/C● Developed by Sun● An attempt to separate out the connector● GPL licensed ○ Also has commercial license ○ Has FLOSS Exception● No release since 2009-08-10 (6.0.2)
  18. 18. CMariaDB Client Library● Developed by Monty Program Ab and SkySQL Ab● A fork of MySQLs 3.23 client library ○ Also contains some parts of MySQLnd● LGPL licensed● Features added to catch up with current API
  19. 19. C/C++Libdrizzle● Developed by Open Source community ○ Companies such as Sun and Rackspace have been involved● C API (some C++ in 2.0)● BSD licensed● Part of the main Drizzle project● Speaks both client and server MySQL protocol
  20. 20. CLibdrizzle Redux● Developed by me● A heavily modified version of Libdrizzle● Still under the Drizzle umbrella ○ But different tree● Still BSD licensed● Server API removed● More simplified client API● New features ○ Binlog retrieval API ○ Compression Protocol (coming in 2013) ○ Prepared Statements (coming in 2013) ○ libmysqlclient compatible API (coming in 2013)
  21. 21. C API ExampleSetupMySQL APIconn = mysql_init(NULL);mysql_real_connect(conn, "localhost", "user", "passwd","testdb", 0, NULL, 0);Drizzle APIdrizzle = drizzle_create();con = drizzle_con_add_tcp(drizzle, "localhost", 3306, "user","passwd", "testdb", 0);ret = drizzle_con_connect(con);
  22. 22. C API ExampleQueryMySQL APImysql_query(conn, "SELECT * FROM t1");result = mysql_store_result(conn);num_fields = mysql_num_fields(result);while ((row = mysql_fetch_row(result)))...Drizzle APIresult = drizzle_query_str(con, "select * from t1", &ret);ret = drizzle_result_buffer(result);num_fields = drizzle_result_column_count(result);while ((row = drizzle_row_next(result)))...
  23. 23. C++Connector/C++● Developed by Oracle● JDBC 4.0 API compatible ○ Although only about 80% implemented● GPL licensed ○ Commercial also available ○ Has FLOSS Exception
  24. 24. CConnector/ODBC● Developed by Oracle● GPL Licensed ○ With FLOSS Exception ○ Commercial available● Is a plugin for the ODBC framework, so good for commercial
  25. 25. C#Connector/NET● Developed by Oracle● GPL Licensed ○ With FLOSS Exception ○ Commercial available● Implements ADO.NET interfaces
  26. 26. PHP Connectors
  27. 27. PHP● Three different connectors ○ mysql ○ mysqli ○ pdo_mysql● All three use either libmysqlclient or MySQLnd
  28. 28. PHPlibmysqlclient based● PHP cant link to GPL● PHP 3 dual licensed PHP/GPL● PHP 4 onwards licensed PHP only ○ So couldnt link to libmysqlclient ○ But libmysqlclient has FLOSS Exception● MySQLnd instead!
  29. 29. PHPMySQLnd● Developed by Oracle● C based MySQL client library for PHP● Licensed under PHP license
  30. 30. Python Connectors
  31. 31. PythonMySQLdb● Independently developed● GPL licensed● Wraps around libmysqlclient● Supports Python DB-API 2.0
  32. 32. PythonConnector/Python● Developed by Oracle● GPL licensed ○ With FLOSS exception ○ Commercial also available● Native driver● Supports Python DB-API 2.0
  33. 33. Python FrameworkSQLAlchemy● MIT licensed● Gets around linking problem● Uses DB-API 2.0 connectors
  34. 34. Java Connectors
  35. 35. JavaConnector/J● Developed by Oracle● GPL Licensed ○ Also has commercial license ○ With FLOSS exception● JDBC Type 4 driver ○ So no linking with app required
  36. 36. JavaDrizzle JDBC● Developed by Open Source community ○ Companies such as Sun and Rackspace have been involved● BSD Licensed● JDBC Type 4.0 driver
  37. 37. JavaMariaDB Client Library for Java● Developed by Monty Program Ab and SkySQL Ab● A fork of Drizzle JDBC● LGPL Licensed● JDBC Type 4.0 driver
  38. 38. Other Interfaces
  39. 39. Node.js● Many available! ○ Around 10 projects● node-mysql appears to be most prominent ○ MIT licensed ○ Appears to be a Native driver
  40. 40. NoSQL Interface● Developed by Oracle● Included in MySQL 5.6● GPL Licensed ○ With a commercial version ○ Unsure about FLOSS Exception● Based on Memcache API● Direct access to InnoDB tables
  41. 41. MySQL Cluster● NDBAPI & MGMAPI ○ NoSQL interface● Memcache based NoSQL interface● Java APIs
  42. 42. PluginsPossible to create things like● UDP● HTTP / RESTRead my book to find out more:
  43. 43. Thank you!My work (were hiring!):http://hpcloud.com/Twitter / Freenode IRC nick:LinuxJediEmail:andrew@linuxjedi.co.uk / linuxjedi@hp.com

×