I have recently discovered the Java RMI API and I am using the
Rmiregistry to store and get the remote objects.
Then, I saw that we can use LDAP to do this task. I was interseted by this approach but after some research, I became a little bit confused between these two options.
For now, what I have understood is that :
- Both can be used to store and collect remote objects
- LDAP is accessed by the JNDI API whereas the Rmiregistry is available directly
What I would like to know is the pros and cons of each option, and mainly, when (and why) it is recommended to use one instead of the other.
Most people use the Registry. You might use LDAP if you already have an LDAP server, but you wouldn’t go to the trouble of installing an LDAP server just for RMI.
The RMI Registry participates in DGC where an LDAP server doesn’t.
- LDAP supports hierarchical namespaces where the RMI Registry’s is flat.
Other than that. I can’t think of any major differences.