Java – distributed shared memory or not to be


I need to share data between C++ client and Java server.
The Client talks to the server using SOAP.

The issue is – I have a generic interface serving all kinds of requests on the Java backend.
I don't want to pollute it with specific kind of request object which will most of the times remain null.

So I'm looking for a creative solution:

  1. DB – C++ client writes to temporary (in memory) DB table, passes the ObjectKey to Java. Java creates an object from the record. Table is cleaned up each hour.
  2. Shared Memory Cache – C++ saved object to cache, Java fetch the object.
  3. SOAP – C++ passed the object as part of the SOAP request.
  4. MORE – ???

This must be as efficient as possible solution.
I would love to hear other alternatives that I don't know of.

Best Solution

You could use a REST approach as an alternative to SOAP. It would cut down some of the SOAP overhead. However, I think writing directly to some memory cache sounds more efficient.