Specifying the Table and Column Mapping for an InnoDB + memcached Application
Here is an example showing howto use your own table for a MySQL application going through the
InnoDBmemcachedplugin for data manipulation.
First, we set up a table to hołd some country data: the population, area in metric units, and ' Rł or 'L'
indicating if people drive on the right or on the left.
Now we make a descriptor for this table so that the InnoDBmemcachedplugin knows
how to access
it:
• The sample entry in the CONTAINERS table has a name column 'aaa'; we set up another identifier
' bbb *. If we madę a single master table for all memcachedapplications to use, we would make the
ID 'default' and skip the 00 requests to switch tables.
• We specify the test .multicoltable. The schema name is stored in one column and the table
name is stored in another column.
• The key column will be our unique country value. That column was specified as the primary key
when we created the table above, so we also specify the index name ' PRIMARY' here.
• Rather than a single column to hołd a composite data value, we will divide the data among three
table columns, so we specify a comma-separated list of those columns that will be used when storing or retrieving values.
• And for the flags, expire, and CAS values, we specify corresponding columns based on the settings
from the sample table demo. test. These values are typically not significant in applications using the
InnoDBmemcachedplugin, because MySQL keeps the data synchronized and there is no need to
worry about data expiring or being stale.