I'm new to java ee and I'm not sure how to implement a particular requirement.
I have need for a large set (millions) of objects that maintain a bunch of rules and state and present an API for clients. Each of these objects is long lived. Given that there're so many of these things, we'll likely need to shard them across many VMs and use RMI to access them.
My question is whether there's a Java EE approach to solve the problem of locating an instance of the object, allowing the clients to get a reference to the object without needing to be aware of which machine it is on.
I'm aware of JNDI, but I'm not sure that registering each of the objects in a JNDI directory is appropriate. Do I need to write a "Locator" library that can make itself aware of the VM that each object belongs to?