RSS
 

Archive for the ‘database’ Category

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.

/usr/share/percona-xtradb-cluster/innodb_memcached_config

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.

 

Oracle NoSQL Database

14 May

Yes, this is true, ORACLE has come up with a NoSQL solution. not sure yet what’s their position in the NoSQL race yet.

From what I know about the MySQL Cluster, I can guess it could be based on something like it on the inside. But wrapped into a more NoSQL API, interestingly MySQL cluster also comes with a primarily C++ NoSQL API known as NDB++. I’ll perform a comparison between the two and share the finding in a later post.

Data is stored as key-value pairs, which are written to particular storage node(s), based on the hashed value of the primary key. Storage nodes are replicated to ensure high availability, rapid failover in the event of  a node failure and optimal load balancing of queries. Customer applications are written using an easy-to-use Java API to read and write data. The NoSQL Database links with the customer application, providing access to the data via the appropriate storage node for the requested key-value.

Oracle NoSQL Database Architecture

In the mean time, if you would like to know more here is a list of features.

  • Simple Data Model
    • Key-value pair data structure, keys are composed of Major & Minor keys
    • Easy-to-use Java API with simple Put, Delete and Get operations
  • Scalability
    • Automatic, hash-function based data partitioning and distribution
    • Intelligent NoSQL Database driver is topology and latency aware, providing optimal data access
  • Predictable behavior
    • ACID transactions, configurable globally and per operation
    • Bounded latency via B-tree caching and efficient query dispatching
  • High Availability
    • No single point of failure
    • Built-in, configurable replication
    • Resilient to single and multi-storage node failure
    • Disaster recovery via data center replication
  • Easy Administration
    • Web console or command line interface
    • System and node management
    • Shows system topology, status, current load, trailing and average latency, events and alerts

 

 
 

The all new MySQL Librarian

13 Aug

MySQL Community just got a great a tool that allows then to systematically share the community knowledge about this amazing open source database server. This is just a short post to mark the introduction of this facility to the public. All you need is a valid user account on http://dev.mysql.com and you are done.

You can click here for further details.