149 points · by alpb · 14y ago · 43 comments
MySQL development server, not meant for production use, in development for almost 2 years, release date unknown, now includes memcached, and a plugin that allows fast NoSQL-style access.
I hope they are taken seriously however; I'd like to see all the major RDMS tightly integrate memcache in front. It only makes sense, web developers have been doing it themselves since LiveJournal's hayday.
"MySQL 5.6 includes a NoSQL interface, using an integrated memcached daemon that can automatically store data and retrieve it from an InnoDB table. By default, you use the memcached API purely to speed up database operations, letting InnoDB handle memory caching using its buffer pool mechanism. Advanced users can enable the traditional memcached in-memory caching and control whether operations look up and store data in memory, in InnoDB tables, or both. This offering provides users with the best of both worlds"
The MySQL server now includes the widely used memcached in-memory caching system, and a plugin that allows fast NoSQL-style access to InnoDB tables through the memcached protocol. This access method avoids the overhead of SQL parsing and constructing a query optimization plan. You can store the underlying data in a single InnoDB table, or spread it across multiple tables. You can read and write data through both memcached and SQL. For example, you can do fast single-key lookups through memcached get calls, and do statistical reports across all the data through SQL.
http://dev.mysql.com/doc/refman/5.6/en/innodb-memcached.html
> This configuration differs from another popular MySQL NoSQL solution, HandlerSocket, by skipping even the Handler API layer and directly accessing the InnoDB storage engine through low-level APIs, making the code path even shorter and more efficient.
[1] http://www.oszone.co.kr/reference/refman-5.6-en.html-chapter...
[2] http://dev.mysql.com/doc/refman/5.6/en/innodb-memcached-bene...
As far as I can make out, the memcached server software itself is not included in MySQL right?
SELF CORRECTION:
No, it does seem to include memcached as well for write through caching. Interesting. http://dev.mysql.com/doc/refman/5.6/en/innodb-memcached-bene...
However, I wish there's something in reverse: Redis as a MySQL storage engine. The most obvious useful things is that you can save a `tags` table without m2m tables, juse use Redis sets.
Cache link, since I can't find it on dev.mysql.com:
http://webcache.googleusercontent.com/search?q=cache:II_A7LF...
App Engine FTW!
[1](https://developers.google.com/appengine/docs/python/memcache...)
No, it doesn't.
"The Memcache Python API High performance scalable web applications often use a distributed in-memory data cache in front of or in place of robust persistent storage for some tasks"
MySQL memcached is not a cache, it's a persistent storage with memcached API. And it's fast.
MySQL memcached is a memcached deamon that uses InnoDB storage instead of in-memory storage. The caching is done by InnoDB itself.
(and actually it's possible to enable the optional in-memory storage too)
http://dev.mysql.com/doc/refman/5.6/en/innodb-memcached.html
Last line: "If there is no innodb_memcache.containers.name value of default, the row with the first name value in alphabetical order is used. "
This is in regards to which table is used as the default for get/set operations. Anyone else foresee this leading to mass confusion/issues for unsuspecting users down the road?
All these caching things make applications complex, because cache invalidation it's a complex task.
MySQL is doing right steps - it's doing caching itself via InnoDB buffer pool. And makes the interface faster by replacing SQL queries with fast memcached API.
It seems like there are a few tuning modes relayed in the documents that have various persistence trade-offs, though, so the performance angle of the protocol could come into play.
I'd like Postgres to be able to support some kind of carefully-sized multi-backend caching utility someday, but as an extension if at all possible. I think such a thing is technically not that exotic (but still a lot of work), yet does not exist AFAIK. Prepared statements would usually be fast enough as-is if one had the right backend functions (UDFS) I suspect.
It doesn't even go over the SQL interface, it's not text-based.
http://dev.mysql.com/doc/refman/5.6/en/innodb-memcached-bene...