I'm creating a social application on the top of Java and Cassandra database. I have to store posts/comments from the user's shared posts, in database that I'm searching to serialize data per single comment/publish &lifier then store serialized data within the database in a single column. Thus for every comment, there will be considered a single column that stores this data in serialized format:-

  1. Comment data(String around 700 figures max)
  2. CommentorId (lengthy type)
  3. CommentTime (timestamp)

Similarly a posts' data is going to be serialized and saved like a single column.

Fast Deserialization could be needed each and every retrieval of this publish through the frontend.

I'm searching at protocol buffers because the probable solution with this. Want to know whether selecting protocol buffers with this task is the best choice or otherwise. I'm searching for a higher performance &lifier fast serialization &lifier deserialization formula that may serve for heavy usage within the application.

Also, can you really send the information in serialized format, to client after which there can it be deserialized ? server to client communication?

Have no idea in the event that matches your particular situation but I've come across tips to store a JSON representation from the data that may be directly delivered to the browser. If you do not need any more processing steps including POJOs than the or perhaps a similar approach may well be a (fast) approach to take.

Overall, it appears like Protocol Buffers is a great fit for which for you to do. Lots of people utilize it exactly for which you've referred to. I learned about many others using plain JSON for your, but it's certainly less capable.

Protocol Buffers is fast, portable, mature and well-recorded. It's developed and maintained by Google. Among the distinctive options that come with Protocol Buffers is a chance to transparently extend existing records with new fields. For example, you are able to extend your overall record format to contain another fields without transforming your overall data or modifying software that actually works with old fields (because it will quietly discard unknown fields).

Relating to your question about whether client can function with serialized format (basically understood the question properly). If your client supports Protocol Buffers and also have the ".proto" files explaining data format, they will have the ability to use it exactly like you do. If your client can't use Protocol Buffers, you will find some third-party libraries [1] that may convert between Protobuf, JSON and XML formats (I've not attempted with them myself).

You could also want to look at some options to Protocol Buffers, for example Message Pack [2] and Avro. They tell you they are faster / smaller sized / have support for dynamic typing.

[1] for instance, http://code.google.com/p/protobuf-java-format/

[2] http://msgpack.org/

protocol buffers certainly provides serialization, even though RPC aspect remains for your imagination (frequently something easy and socket-based is effective).

The information-types are well based on protobuf (although you might like to use something similar to ms in to the unix epoch for that date). Note though that protobuf does not include compression (unless of course additionally you apply gzip etc towards the stream). Therefore the message is going to be "a little more than the string (which always uses UTF-8 encoding in protobuf). I only say a "a little" since the varint formula for integer types could give anything between 1 and 10 bytes each for that id and timestamp, based on their magnitude. Along with a couple of (3, most likely) bytes for that area headers.

In the event that sounds about right, it should work fine. For those who have plenty of text data, though, you might like to run the protobuf stream through gzip too. Java has excellent support within protobuf through the primary google trunk.