3

I am working on a Memcached implementation with MySQL Cluster 7.2. I have installed and configured memcached with following parameters:

PORT="11211" 
USER="mysql" 
MAXCONN="1024" 
CACHESIZE="1024" 
OPTIONS="" 

but Memcached is working irrespective to the MySQL engine (i.e. when inserting to Memcached it is not storing into database)

Can any one help me out giving parameters so that it will access the ndb engine and store the values in both memcache and also in database?

I am not able to figure out the relation between the two.

1

I don't believe this is possible. From the FAQ on the MySQL and Memcache section:

memcached plays no role in database writes, it is a method of caching data already read from the database in RAM.

So inserting a value into memcached should not be expected to update the MySQL database. One major problem is that memcached has no knowledge of how and where that data should be stored. All it is is a key/value store in RAM.

The same is not true going the other way. You can modify data in the database, and have it updated in memcache. From the same FAQ:

You can use the MySQL UDFs for memcached and either write statements that directly set the values in the memcached server, or use triggers or stored procedures to do it for you.

Obligatory helpful link to the MySQL UDF documentation.

2

The basic docs for using the Memcached API for MySQL Cluster 7.2 start at http://dev.mysql.com/doc/refman/5.5/en/mysql-cluster-ndbmemcache.html

On the memcached command line, you need to supply an option like "-E ndb_engine.so". Memcached has a "pluggable engine" architecture, and the MySQL Cluster component is implemented as an NDB Engine. When memcached starts up with the correct engine you should see a log message like this:


01-Mar-2012 11:27:27 PST NDB Memcache 5.5.20-ndb-7.2.5 started [NDB 7.2.5; MySQL 5.5.20]
Contacting primary management server 

  • So I'm clear on what I'm reading, with NDBengine you can issue SET/DELETE commands to memcached that actually modify the underlying cluster tables (thus making my answer wrong for mysql cluster)? – Derek Downey Mar 1 '12 at 21:37
1

To follow up on JD's response, you can view a worked example of using the Memcached API to MySQL Cluster at http://www.clusterdb.com/mysql-cluster/scalabale-persistent-ha-nosql-memcache-storage-using-mysql-cluster/

You can choose whether certain key-value pairs are stored in Memcached, MySQL Cluster or both by setting up meta-data in the database.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.