Memcached plugin with XTRADB Cluster / Galera

23 Mar

Having used memcached plugin for InnoDB in single node installations in the past with satisfacroty results, I wondered if it was possible to create a clustered setup which allows better scaling and provided replication of keys & values from one Memcached to another one, thus allowing more concurrent reads and prevention of the cold cache problem in the event of a restart that’s usual in a sharded cluster. I have been using Couchbase for a while with great results, but wanted to find something that could be made available to legacy applications for instance running versions of PHP that can’t do a native Couchbase client. (No doubt Couchbase does Memcache, but still wanted to check if Galera was up to the task) So I was wondering if it is possible to put something together using XTRADB Cluster / Galera as a back end for Memcached. I found some documentation that explained how to setup such an arrangement for NDB cluster but that makes use of a special memcached plugin for NDB. Couldn’t find a mention of the InnoDB Memached plugin being usable with Galera / XTRADB anywhere, so I decided to try it out myself.

I started up my dev cluster and setup the innodb memcached plugin using the script included with the XTRADB cluster. This creates a InnoDB Memcache config database and creates a test mapping to a table in the test schema called demo_test.


So, the above script caused the database and mapping to be created on all three XTRADB nodes I had in the cluster. I tested a few reads of the test data from all the nodes using memcached port 11211 and they all seemed to respond fairly well. So, I decided to send some SET requests and check if those replicate. So, I ran a SET operation on one of the nodes and the demo_test table got the data, but to my disappointment the other nodes didn’t get it. It appeared as if the Galera layer didn’t know that Memcached plugin had inserted some data into InnoDB. I remembered that there is a variable  innodb_api_enable_binlog that controls if the Memcached updates will be written to MySQL Binary log, that defaults to off and I didn’t change it to on.

So, i changed the value of that variable to on, restarted the cluster to make the value effective. Tested reads with memcached and they were fine. Then I ran some writes through memcached and it was still the same. So, I concluded that memcached plugin writing to InnoDB goes unnoticed by the Galera library. I’ll dig into the code to see why that doesn’t work. I wonder if anyone else has had the same experience?

I also intend to upgrade my cluster to a newer version and repeat the tests. I am currently testing on XTRADB cluster 5.6.25 on CentOS 6.7 32 -bit.


Couchbase server 3 Beta 2

22 Sep

I have been eagerly looking forward to Couchbase server version 3’s final edition to come out. Looks like we just came a bit closer to that as Couchbase have announced beta 2 for version 3. I am going to give it a go.

Please use the link below to download and test it out.

Download Couchbase version 3 Beta 2


Watch “Mod-09 Lec-02 MOSFET : Device Structures and Char…” on YouTube

04 Sep

Mod-09 Lec-02 MOSFET : Device Structures and Char…:


Watch “Logstash Presentation” on YouTube

13 Jul

Logstash Presentation:


cNet Top 5 : Best features in Apple iOS 8

25 Jun

Donald Bell explains the best features in upcoming iOS8. The better keyboard is something that might make me think about considering an iPhone for my next phone upgrade 🙂

No Comments

Posted in iOS, OS


Android Headlines: Designer Google Glass Frames And Shades From Diane Von Furstenberg Now Available

24 Jun

Android Headlines: Designer Google Glass Frames And Shades From Diane Von Furstenberg Now Available.


Google Glass on sale in the UK for £1,000

24 Jun

The Guardian: Google Glass on sale in the UK for £1,000.


Watch “Introduction to Docker” on YouTube

23 Jun

Introduction to Docker:


Introduction to Angular.js in 50 Examples (part 1)

20 Jun

Quite an enjoyable video, one of the best introductions to Angular.JS

Introduction to Angular.js in 50 Examples (part 1):


Watch “Intel Galileo Show-and-Tell” on YouTube

08 Apr

The Intel Quark processor, derived from the Pentium consumes a lot lower power than the Atom. Featured on the Intel Galileo boards now. Please watch the Show-and-Tell video from the Make: magazine: