views:

371

answers:

2

I'm investigating options to create a database cache using HSQLDB in an in-memory mode. The idea is that the cache will be queried from a PHP application and the query will be passed to a Java application that runs the HSQLDB database.

Now, I've been thinking this through and I can't see any efficient way to pass the data from Java back to the PHP app. I know XML is an option, and so is JSON but i'm not sure if the additonal processing will be an overhead? Ideally I just want to pass an array of data back from the java to the php like what you would get with mysql_fetch_array or something.

I know it seems like a weird question, and probably seems completely illogical but i'm just exploring this option so please bare this in mind!

+1  A: 

Two possibilities are Facebook's thrift and Google's protocol buffers. Thirft is probably a better choice for you since support for PHP in protocol buffers is fairly limited.

Jay Askren
+1  A: 

There is also Hessian (http://hessian.caucho.com/) If performance is what you are after I think Hessian is at or near the top - though the binary mode in Thrift is no slouch.

jckdnk111