Simple, probably dumb question: Suppose I have a Java server that stores in memory commonly used keys and values which I can query (let\'s say in a HashMap)
What\'s the
It depends on what you're wanting. An in-memory map will be faster; data expiry isn't really an issue (see: Google Guava's MapMaker, which can create a map that expires entries after reads and/or writes, and let's not forget things like OSCache and EHCache, not to mention distributed things like GigaSpaces XAP or Coherence).
The caching projects (XAP, OSCache, EhCache, Coherence, etc) can distribute cache entries, so you get natural sharding and other facilities; Coherence can manage transactions and write-through, and XAP is actually designed to serve as a system of record (where writing to it gets synchronized and replicated, such that you are using an in-memory data grid as your actual data storage mechanism rather than using a database.)
Memcached is... well, you can access a memcached server instance from a series of machines. Memcached as an API is simply a key/value store, and distribution is entirely accomplished on the client side. It's certainly got the basics, I guess, and it's definitely got multiple language APIs, but it's really pretty limp otherwise.
(BTW, GigaSpaces has a Memcached layer, so you could theoretically use memcached as a system of record...)