MySQL 5.6 — InnoDB and Memcached


One of the more exciting new features in MySQL 5.6 is the InnoDB to Memcached interface. Basically memcached runs as a daemon plugin and can bypass the SQL optimizer and parser for NoSQL access.

The first step is to download the new MySQL 5.6 with the InnoDB-Memcache preview. Sorry, Linux only at this time. And install memcached.

Second, run the provided configuration script mysql> < scripts/innodb_memcached_config.sql. This will do a lot of the work to get things running out of the box and one of the links below details what is happening behind the scenes when you run the script. Third, load the plugin mysql> install plugin daemon_memcached soname “libmemcached.so”;. Forth, to make sure we can see recently inserted data, you will need to set the transaction level mysql> set session TRANSACTION ISOLATION LEVEL read uncommitted;

Fifth step, feed some data into the provided InnoDB demo table mysql> INSERT INTO demo_test VALUES ('dave','it works', 10, 200, NULL).

Now, can we get memcached to get the data from InnoDB?

MySQl 5.6 Memached-InnoDB

Using memached to get the data from InnoDB

Yes! This is a very simple example using the ‘canned’ configuration. Your mileage may vary and this server is a preview and not for production. But there is a lot more stuff in there that I will be looking into soon.

About these ads

9 Comments

Filed under InnoDB, Memached, MySQL

9 responses to “MySQL 5.6 — InnoDB and Memcached

  1. Pingback: MySQL 5.6 — InnoDB and Memcached | Database, MySql, Oracle, SQL and more

  2. Hi

    Good job on the article which is well written.
    This is a great blog!

    I definitely clicked the ‘Like’ button. :-)

    Feel free to visit my blog too, over at http://geekleague.wordpress.com.

    Greetings
    Geek League

  3. Why is it required to use READ_UNCOMMITTED?
    If using READ_COMMITTED, will I not see any committed transaction’s result?

    • I set it to READ_UNCOMMITTED to see what I hoped was a best case for speed could be. But I am not seeing any difference between READ_COMMITTED and READ_UNCOMMITTED; that is probably the fault of my testing procedures.

  4. smu

    It’s works with the actual versions (mysql-5.6.6-labs-june-2012-winx64.zip) also? From where do you get the libmemcached.so? I can’t find it also in the linux version. any idea?

  5. Shri Javadekar

    I am trying this on MySQL 5.6.16. Are you sure this procedure still holds true. I insert a new row in the test.demo_test table but I can’t get back the value when I fetch it from telnet.

    I verified using “show plugins” that the daemon_memcached plugin is enabled. Don’t see anything in the logs. Any ideas?

    • Can you see it through memcached?

      • Shri Javadekar

        Actually, the problem was that there was another memcached instance running on the default port (11211). So when using telnet to connect to memcached, I wasn’t really connected to the memcached instance running with MySQL. Ideally, mysql should’ve complained about not being able to use that port and error out. But it doesn’t :(.

        Neways, I stopped the memcached instance and restarted mysql so that it could get access to that port. After that things worked fine.

        Thanks for following up!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s