If you need to store heterogeneous collections of items, as you probably would like to in a distributed hashmap, you should just make the type of stored objects binary, and then handle the serialization/deserialization at the application level. This will make your hashmap implementation very general and simple, too.

To me this would no longer be a Thrift solution. It requires that data is explicitly serialized/deserialized, and, more importantly, the serialization protocol is probably not implemented in the many languages that Thrift supports. What if somebody wants to use your Thrift service and writes a client program for it, only to find out that he cannot use the binary data stored in the maps? If you decide to go this route, make sure you understand the implications.

If heterogeneous/polymorphic data (in containers or otherwise) is needed, I suggest to use another RPC protocol, e.g. RMI or SOAP.

--
Kind regards,

Johan Stuyts

Reply via email to