Fast (de)serialization with MessagePack
By Stoyan Zhekov · April 26, 2010
MessagePack is a binary-based efficient object serialization library...like JSON. But unlike JSON, it is very fast and small .
Cython is required to build msgpack, so cannot use it on Google's AppEngine :(
MessagePack is used in kumofs - "...a scalable and highly available distributed key-value store. Its performance is comparable to memcached and scales out linearly..."
Usage from ruby:
# install: gem install msgpack
require 'msgpack'
serialized = {"method" => "Get", "id" => nil, "params" => ["it", 0, 50, false]}.to_msgpack
p MessagePack.unpack(serialized)
Usage from python
# install: easy_install msgpack
>>> import msgpack
>>> msgpack.packb([1,2,3])
'\x93\x01\x02\x03'
>>> msgpack.unpackb(b'\x93\x01\x02\x03')
[1, 2, 3]
See also
- msgpack GitHub repo
- MessagePack Wiki
- MessagePackのPython Bindingをリリースしました (japanese, python)
- MessagePack 0.2.2 リリース (japanese, ruby)
- MessagePack-RPC - an inter-process messaging library that uses MessagePack for object serialization

