ThinkPart

Andrey's blog

 

mysqlnd talk this afternoon

 

In a few hours I will give my talk on mysqlnd. Well, the talk is not mine but we wrote it together with Ulf Wendel, of the MySQL Connectors Team fame. Although we haven't added much functionality to mysqlnd in the recent months mysqlnd is still pretty advanced and started to mature. I will talk about why mysqlnd is unique, why is it cool, why is it fast, and why you should use it!

Yesterday Jan Kneschke, of the lighty and MySQL Proxy fame gave a talk about the proxy and the binary log (replication). Today I attended a talk given by Peter Zaitsev, from Percona, at the Percona Performance Conference, which is free and in the same hotel as the MySQL UC. Peter talked about how to prevent lagging of the MySQL replication and mentioned something I have forgotten. The MySQL replication is single threaded and simple. If you have heavy queries your replication might start to lag. You can't parallelize even if the tables your application updates are orthogonal (independent) to each other. Now, at lunch I am sitting next to Mark Matthews and Jan and Mark mentioned about customers who want replication protocol support in Connector/J . He mentioned that it will be cool to fetch the events from the protocol and automagically create a prepared statement, which you can just execute against a server.

Now add 2 to 2 and see my idea. We said we can have orthogonal tables but we have no threading in the replication thread on the slave. Modifying the server will be hard and take years, so better skip it, let's do it in the client, which can scale good. Fetch the events from the master, look which tables are used in the events, and then parallelize those who use orthogonal tables and serialize that use common set of tables. Neat, right? And I just mentioned my idea and Jan said "well, I presented that yesterday, at my MySQL Proxy meets Replication talk". Well, I did not attend this talk because I was giving a Connector/C++ talk, in the next ballroom. Well, seems in this regard I am as stupid Tongue out as Jan is.

So, if we get the time mysqlnd will rock with this feature too. The platinum version of mysqlnd will:

  • continue to be faster as libmysql
  • continue to use less memory than libmysql
  • be client-side cache loaded
  • be prepared statement cache loaded, when using persistent connections
  • be asynchronous queries enabled (polling and libevent)
  • be background asynchronous queries enabled
  • expose the protocol to the programmer so you can script and filter like you can do in MySQL Proxy
  • rock your world Cool

Leave a reply

Comments are disabled for this post.