InnoDB memcached Architecture The  InnoDB memcached  plugin implements  memcached  as a MySQL plugin daemon that accesses the InnoDB  storage engine directly, bypassing the MySQL SQL layer. The following diagram illustrates how an application accesses data through the  daemon_memcached plugin, compared with SQL. 3353 15.20.2 InnoDB memcached Architecture • InnoDB  can handle composing and decomposing multiple column values into a single  memcached item value, reducing the amount of string parsing and concatenation required in your application. For example, you can store the string value  2|4|6|8  in the  memcached  cache, and have  InnoDB  split the value based on a separator character, then store the result in four numeric columns. •The transfer between memory and disk is handled automatically, simplifying application logic. •Data is stored in a MySQL database to protect against crashes, outages, and corruption. •You can access the underlying  InnoDB  table through SQL for reporting, analysis, ad hoc queries, bulk loading, multi-step transactional computations, set operations such as union and intersection, and other operations suited to the expressiveness and flexibility of SQL. •You can ensure high availability by using the  daemon_memcached  plugin on a source server in combination with MySQL replication. •The integration of  memcached  with MySQL provides a way to make in-memory data persistent, so you can use it for more significant kinds of data. You can use more  add ,  incr , and similar write operations in your application without concern that data could be lost. You can stop and start the  memcached server without losing updates made to cached data. To guard against unexpected outages, you can take advantage of  InnoDB  crash recovery, replication, and backup capabilities. •The way  InnoDB  does fast primary key lookups is a natural fit for  memcached  single-item queries. The direct, low-level database access path used by the  daemon_memcached  plugin is much more efficient for key-value lookups than equivalent SQL queries. •The serialization features of  memcached , which can turn complex data structures, binary files, or even code blocks into storeable strings, offer a simple way to get such objects into a database. •Because you can access the underlying data through SQL, you can produce reports, search or update across multiple keys, and call functions such as  AVG()  and  MAX()  on  memcached  data. All of these operations are expensive or complicated using  memcached  by itself. •You do not need to manually load data into  memcached  at startup. As particular keys are requested by an application, values are retrieved from the database automatically, and cached in memory using the InnoDB  buffer pool. •Because  memcached  consumes relatively little CPU, and its memory footprint is easy to control, it can run comfortably alongside a MySQL instance on the same system. •Because data consistency is enforced by mechanisms used for regular  InnoDB  tables, you do not have to worry about stale  memcached  data or fallback logic to query the database in the case of a missing key.