Skip to content

Chapter Background Beyond JSON

Tatu Saloranta edited this page Dec 1, 2016 · 3 revisions

Jackson Manual: Background - Beyond JSON

After implementing support for many of complicated aspects of data-binding (such as handling of polymorphic types, for example), I got interested in possible support for data formats other than (textual) JSON. One inspiration for this came, once again, from XML world: there are binary encoding alterative for logical XML content: generically called as "binary XML". These encodings allow for more compact storage and efficient transfer, while still allowing same logical processing using things like DOM, XSLT and XQuery.

In case of JSON, there were proposed binary JSON encodings, for example BSON. Despite their flaws, the general concept of having more compact representation of logical content expressed as JSON is valid. With that in mind, I worked with my colleagues at Ning.com to define such binary encoding for JSON: Smile. To allow reading/writing of Smile-encoded data, there was need to define a way to extend and override handling of underlying content: fortunately the original design made this relatively easy: implementation of "Streaming API" is sufficient so that neither Tree Model nor Data-binding functionality need to be aware of content being read or written uses encoding different than JSON.

Support for Smile format was added about 3 years after Jackson project started, and since then support has been added for a dozen other data formats. These will be covered in more detail in [Chapter X].