A huge number of objects, a splinter and java EE

I am new to java ee and I'm not sure how to implement a specific requirement.

I need a large set (millions) of objects that support a bunch of rules and states and represent APIs for clients. Each of these objects is durable. Given that there are many such things, we will probably have to wrap them in many virtual machines and use RMI to access them.

My question is whether there is a Java EE approach to solve the problem of placing an instance of an object, which allows clients to get a reference to the object without worrying about which machine it is on.

I know JNDI, but I'm not sure if registering each of the objects in the JNDI directory is appropriate. Do I need to write the Locator library, which can itself be aware of the virtual machine to which each object belongs?

+4
source share
2 answers

Without any specific details, let me suggest several paths for research.

If I read you correctly, then you want something similar to DHT , but for placing and searching for objects (code + data) or service nodes, not just raw data. I do not know about such a platform, although it seems really interesting.

Java EE itself (as a specification) does not indicate, and the reference implementation does not provide an out of the box solution for distributed clustering and the fragments that I think you are looking for.

Glassfish (Java EE RI) itself uses Shoal as a clustering structure that can use either Grizzly or JGroups as the underlying communication platform.

So, in your specific case, I would look at the creation and at JGroups for group communications. Then, instead of the central registry, we rely on DHT to host the service / facility. See how existing, successful DHT-based platforms (memcached, Apache Cassandra) implement partitioning and searching, fault tolerance, and switching to another resource and simply adapt / apply them. Then you can use RMI / RPC for client-server calls (node ​​service).

Hope I make sense, and good luck! If you do this yourself, see if you can open it .;)

+2
source

I cannot directly answer your question, but I know that Oracle Coherence cannot just distribute data, but it can also distribute calculations against that data.

A simple code example is here. You write your calculation through a class that implements com.tangosol.uti.InvocableMap.EntryProcessor. This will allow the calculation to take place on the server where the data is available. One statement is that the data must be serializable as it travels across the network.

public class CalcLogic implements EntryProcessor { .... //InvocableMap.Entry is the "data" //You write your calculation in this process methods. public Object process(InvocableMap.Entry entry { (YourObjectType) obj = (YourObjectType)entry.getValue(); //do some calculation against obj here entry.setValue(obj); return null; } .... } 
0
source

All Articles