Reputation: 1249
What's the difference between memcache and buffer pool in MySQL? It seems to me that both use memory as buffer/cache so as to reduce disk I/O.
Thanks!
Upvotes: 1
Views: 1623
Reputation: 1551
Memcache
memcached is a simple, highly scalable key-based cache that stores data and objects wherever dedicated or spare RAM is available for quick access by applications, without going through layers of parsing or disk I/O. To use, you run the memcached command on one or more hosts and then use the shared cache to store objects.
InnoDB buffer pool
The memory area that holds cached InnoDB data for both tables and indexes. For efficiency of high-volume read operations, the buffer pool is divided into pages that can potentially hold multiple rows. For efficiency of cache management, the buffer pool is implemented as a linked list of pages; data that is rarely used is aged out of the cache, using a variation of the LRU algorithm. On systems with large memory, you can improve concurrency by dividing the buffer pool into multiple buffer pool instances.
Several InnoDB status variables, information_schema
tables, and performance_schema
tables help to monitor the internal workings of the buffer pool. Starting in MySQL 5.6, you can also dump and restore the contents of the buffer pool, either automatically during shutdown and restart, or manually at any time, through a set of InnoDB configuration variables such as innodb_buffer_pool_dump_at_shutdown
and innodb_buffer_pool_load_at_startup
.
Memcache integration with InnoDB
MySQL 5.6 includes a NoSQL interface, using an integrated memcached daemon that can automatically store data and retrieve it from InnoDB tables, turning the MySQL server into a fast “key-value store” for single-row insert, update, or delete operations. You can still also access the same tables through SQL for convenience, complex queries, bulk operations, application compatibility, and other strengths of traditional database software.
http://dev.mysql.com/doc/refman/5.6/en/innodb-memcached-benefits.html
http://dev.mysql.com/doc/refman/5.6/en/innodb-memcached.html
For more information on memcache refer: http://dev.mysql.com/doc/refman/5.0/en/ha-memcached-using.html
Upvotes: 2