mysql in-memory table as a cache?
I'm curious if anyone has used an in-memory mysql table as a cache. I've got some ad-hoc data browsing needs that memcached is not well suited for. The data doesn't change often, so there is no real need to be making normal SQL calls. I've read that the ACID overhead on these memory tables is almost insignificant, and since the data is all in memory it sounds like a reasonable caching solution.
I'm just curious if anyone has used this approach before.
(
9 comments
| 4 points
| on HN
)
If you're set on MySQL, assuming you are on Linux (or a similar platform) you should consider perhaps using BDB or MyISAM for your storage engine and just keeping the data on a ram disk. This will give you wicked fast reads.
However the memcached code path is pretty lean and will give you better performance than in-memory mysql for single key/value lookups.
You could use memcached. However, if you are developing REST web services, you can retrospectively introduce Squid without changing your code.
The problem with memcached is that I want to access the data sequentially, page by page. I can't seem to find a feasable way to store an ordered list (without really bad insert performance).