MsgPack for compressing json data, why not using gzip/deflate?

Afshin Mehrabani picture Afshin Mehrabani · Oct 16, 2012 · Viewed 13.2k times · Source

I heard something about MsgPack that can be used for compressing json messages, but I have a question about that, why not simply using Gzip/Deflate instead of MsgPack? I think it's so better to debugging also.

Answer

deltheil picture deltheil · Oct 17, 2012

msgpack is an efficient binary serialization format that you may want to choose as an alternative to JSON according to your use case.

Even if it is advertised as like JSON, but fast and small, it is not intended to compress JSON data. Once again think of it as an alternative, and keep in mind that as stated by its author:

there are many situations where it simply does not offer enough advantage to JSON

I would greatly recommend you to read this article - My thoughts on MessagePack, written by msgpack's author, that includes everything you need to know vs. recommended msgpack use cases, pros/cons and other useful pointers related to msgpack and JSON.