There's a patent for storing a specific database structure in memory and therefore MySQL Server memory tables use a hash structure to avoid this patent. This would very well when you lookup a row which is present. However, the entire hash is enumerated when an row is not present. So, perversely, you'd get more performance with MyISAM, a RAID card and a big disk buffer.
You could use memcached. However, if you are developing REST web services, you can retrospectively introduce Squid without changing your code.
Re:mysql in-memory table as a cache?
by bayareaguy on Tuesday February 19, 2008 @08:09AM
(#118863)
Do you know the number of the patent for this?
No idea. However, it specifically affected B-trees in memory. A search revealed US Patent 5283894: Lockless concurrent B-tree index meta access method for cached nodes ( http://www.patentmonkey.com/PM/PatentID/5283894.aspx ) which may or may not be relevant.
However the memcached code path is pretty lean and will give you better performance than in-memory mysql for single key/value lookups.