mindas mindas - 3 months ago 26
Java Question

Choosing a distributed shared memory solution

I have a task to build a prototype for a massively scalable distributed shared memory (DSM) app. The prototype would only serve as a proof-of-concept, but I want to spend my time most effectively by picking the components which would be used in the real solution later on.

The aim of this solution is to take data input from an external source, churn it and make the result available for a number of frontends. Those "frontends" would just take the data from the cache and serve it without extra processing. The amount of frontend hits on this data can literally be millions per second.

The data itself is very volatile; it can (and does) change quite rapidly. However the frontends should see "old" data until the newest has been processed and cached. The processing and writing is done by a single (redundant) node while other nodes only read the data. In other words: no read-through behaviour.

I was looking into solutions like memcached however this particular one doesn't fulfil all our requirements which are listed below:

  1. The solution must at least have Java client API which is reasonably well maintained as the rest of app is written in Java and we are seasoned Java developers;

  2. The solution must be totally elastic: it should be possible to add new nodes without restarting other nodes in the cluster;

  3. The solution must be able to handle failover. Yes, I realize this means some overhead, but the overall served data size isn't big (1G max) so this shouldn't be a problem. By "failover" I mean seamless execution without hardcoding/changing server IP address(es) like in memcached clients when a node goes down;

  4. Ideally it should be possible to specify the degree of data overlapping (e.g. how many copies of the same data should be stored in the DSM cluster);

  5. There is no need to permanently store all the data but there might be a need of post-processing of some of the data (e.g. serialization to the DB).

  6. Price. Obviously we prefer free/open source but we're happy to pay a reasonable amount if a solution is worth it. In any way, paid 24hr/day support contract is a must.

  7. The whole thing has to be hosted in our data centers so SaaS offerings like Amazon SimpleDB are out of scope. We would only consider this if no other options would be available.

  8. Ideally the solution would be strictly consistent (as in CAP); however, eventual consistence can be considered as an option.

Thanks in advance for any ideas.


Have a look at Hazelcast. It is pure Java, open source (Apache license) highly scalable in-memory data grid product. It does offer 7X24 support. And it does solve all of your problems I tried to explain each of them below:

  1. It has a native Java Client.
  2. It is 100% dynamic. Add and remove nodes dynamically. No need to change anything.
  3. Again everything is dynamic.
  4. You can configure number of backup nodes.
  5. Hazelcast support persistency.
  6. Everything that Hazelcast offers is free(open source) and it does offer enterprise level support.
  7. Hazelcast is single jar file. super easy to use. Just add jar to your classpath. Have a look at screen cast in main page.
  8. Hazelcast is strictly consistent. You can never read stale data.