DEV Community

Discussion on: Is Protobufs better than JSON?

Collapse
 
eli profile image
Eli Bierman

Between the two, I prefer the flexibility of JSON and not having to maintain separate schemas and generate language bindings like many of the Protobuf libraries require. If speed or size of the data transfer becomes an issue, I like MessagePack. It’s another binary serialization format like Protobuf, but it’s flexible like JSON and doesn’t require schemas like Protobufs do. It’s also similarly size efficient as Protobufs, and can be extended to support custom types more easily than either Protobufs or JSON in my opinion. 99% of the time JSON is perfect, but a realtime low-latency application like chat or gaming would be a great use case for Protobufs or MessagePack.