I recently checked out Memcached for using it as an in-memory transient database.However, I was wondering why can't we use something like a ConcurrentMap (if I were using Java, for example)or something on the lines of a BST/Java HashSet/C++ std::set. Would there particularly be any disadvantages if I used standard datastructures from a given language's standard library over something like Memcached/Redis?
Using a Concurrent/Normal Data-structures vs Memcached
database;data structures;concurrency
For single-machine applications an in-memory data structure is most likely always the better choice - after all, memcached is just that: a data structure in memory + an interface.However, there is no in-RAM data structure that is accessible from more than one machine. So, as soon as more than one machine has to access that state, something like memcached or redis becomes inevitable.See my answer to a related questionP.S.: Sorry for the self-advertisement but i honestly felt that the answer is a good fit here