Performance: RMI vs JavaSpaces

Discussions

Performance and scalability: Performance: RMI vs JavaSpaces

  1. Performance: RMI vs JavaSpaces (5 messages)

    Hi, I'm new in making distributed applications using Java language.

    My question is, which technology should I use: core RMI or JavaSpaces? The project, which I'm making is a simple real-time-strategy game engine. I'm looking for technology, which generate the lowest network traffic. In first phases of my project I was programming using sockets and my own protocol. But it was hard to extend the existing system. So, I've decided to use some higher-level technology like RMI or JavaSpaces (I guess, that EJB is not quite good option).

    P.S. Sorry for my terrible english :)

    Threaded Messages (5)

  2. Performance: RMI vs JavaSpaces[ Go to top ]

    Take a look at Coherence .. it provides advanced clustering for managing data, messaging, events, etc.

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Shared Memories for J2EE Clusters
  3. Performance: RMI vs JavaSpaces[ Go to top ]

    Having worked with RMI till it I throw up, I must say it has 2 sides:
    good: it is removing the protocol burden.
    bad: it requires some coding discipline, and is not a fast protocol (invocation stuff)

    Having designed many protocols, and having worked with 1.1 applets also, I must say my favorite combination is simple value object serialization over socket.
    Serializing removes the burden of data transport. You just concentrate on the communication.

    You use hashtable/vector (for 1.1 compatibility) of strings, wrappers, arrays of primitives, etc...
    Stay away from non-core objects (avoid your own serializable classes).

    I like to write key-value pair in hashtable, because they make the protocol infinitely extensible. Make sure you toss in a version string, just in case.

    And that's pretty much it!

    There is nothing rmi will do that you can't do with a simple table of properties. Some are command properties (would have been function calls for rmi), some are request/response data properties (rmi args/return values).

    Have fun.
  4. Having designed many protocols, and having worked with 1.1 applets also, I must say my favorite combination is simple value object serialization over socket.Serializing removes the burden of data transport.
    This aproach is the best at least if you want to use the lowest network traffic as possible.

    The problem is that both end-points of the communication must be written in Java. If you are planning to write the client-side of the application in a different language, you should try to use web services. SOAP messages are more expensive that serialized object over RMI (they include the data, the tags, and the envelope) but they allow you a lot of interoperatibility.


    Jose R. Huerga

    http://www.terra.es/personal/jrhuerga
  5. Summarize[ Go to top ]

    Thanks to everyone for your replies! I've finally decided to use Quartz approach, because it use the lowest network traffic as possible (and this was for me the most important thing).

    The project website will be available in first days of next month (under address: http://universekingdom.net ). On more time, thanks to everyone for support.
  6. Performance: RMI vs JavaSpaces[ Go to top ]

    Hi Jacek,
    You are making the right choice by looking at proven solutions for distributed applications. I am obviously biased ;-), but I do suggest that you take a look at GigaSpaces @ http://www.gigaspaces.com for unmatched performance in distributed computing.

    Don't hesitate to contact me directly if you have any questions GigaSpaces (or high-performance Java in general).

    Cheers - Gad

    Gad Barnea
    VP Product Marketing
    GigaSpaces Technologies