1

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?

1
  • How big and what platform?
    – paparazzo
    Commented Mar 1, 2017 at 17:13

1 Answer 1

5

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 question

P.S.: Sorry for the self-advertisement but i honestly felt that the answer is a good fit here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.