Stop using JSON in production

Maxim Zaks
1 min readApr 25, 2020

--

If you need a self describing object notation?

Check out CBOR (Concise Binary Object Representation):

Paste your precious JSON into the playground and see how much bytes you are wasting with JSON.

If you are using JSON + JSON-Schema?

You are really doing something wrong. The main benefit of JSON is that the payload is self describing. The main benefit of Schemas is that it describes the payload. When you have a schema, your payload carrying the description around is redundant. Thats like wearing a mask in an air tight room. It just slows you down and balloons your payload unnecessary.

If you want to have a schema, pick a format which is not self describing, but based around a schema, like Protocol Buffers.

If you need high performance for reading payloads?

Don’t try to build the best / fastest, most amazing JSON (text) parser ever.

Use a format which support random value access and designed for speed, like FlatBuffers.

Use JSON for debugging purposes.

But as with code, please don’t deploy debugging data into production.

--

--

Maxim Zaks

Tells computers how to waste electricity. Hopefully in efficient, or at least useful way.