SlideShare a Scribd company logo
CBOR
The Better JSON
www.hazelcast.com@noctarius2k
Who’s that dude?
• Chris Engelbert
• Manager of Developer Relations @Hazelcast
• Java-Passionate (10+ years)
• Performance
• Garbage Collection
• JVM / Benchmark Fairytales
www.hazelcast.com@noctarius2k
Brief look at the history
www.hazelcast.com@noctarius2k
In the beginning there was darkness…
www.hazelcast.com@noctarius2k
…and binary data
www.hazelcast.com@noctarius2k
…and binary data
www.hazelcast.com@noctarius2k
Debugging binary data is hard
www.hazelcast.com@noctarius2k
Binary data is just a big blob
www.hazelcast.com@noctarius2k
Possible with custom tooling
www.hazelcast.com@noctarius2k
Possible with custom tooling
• unique to this specific use case
• involves model classes to be known
• utilizes workarounds
• generally feels weird :-)
Often:
www.hazelcast.com@noctarius2k
“I need to understand it!”
www.hazelcast.com@noctarius2k
Human Readability, Expressiveness
www.hazelcast.com@noctarius2k
Human Readability, Expressiveness
<fun>

<with>

<xml dont:you="think" />

</with>

</fun>
www.hazelcast.com@noctarius2k
Human Readability, Expressiveness
www.hazelcast.com@noctarius2k
Human Readability, Expressiveness
This is not a flame graph!
www.hazelcast.com@noctarius2k
Human Readability, Expressiveness
This is not a flame graph!
<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-failsafe-plugin</artifactId>

<version>${maven.failsafe.plugin.version}</version>

<configuration combine.self="override">

<redirectTestOutputToFile>true</redirectTestOutputToFile>

<argLine>

${jacoco.agent.argLine}

-Xms129m -Xmx1G -XX:MaxPermSize=129M

-Dxyz.feature1.enabled=false

-Dxyz.feature2.enabled=false

-Dxyz.feature3.type=none

-Dxyz.feature4=true

</argLine>

<includes>

<include>**/TestCast*.java</include>

<include>**/IntegrationTestCase*.java</include>

</includes>

<groups>

com.xyz.test.annotation.QuickTest,

com.xyz.test.annotation.SlowTest,

com.xyz.test.annotation.NightlyTest

</groups>



</configuration>

<executions>

<execution>

<goals>

<goal>integration-test</goal>

</goals>

</execution>

</executions>
</plugin>
www.hazelcast.com@noctarius2k
Too verbose!
www.hazelcast.com@noctarius2k
Too understandable?!
www.hazelcast.com@noctarius2k
Just gross?
www.hazelcast.com@noctarius2k
Grossbusters!
www.hazelcast.com@noctarius2k
There is no Dana, only Zuul!JSON
www.hazelcast.com@noctarius2k
Human Readability, Concise
www.hazelcast.com@noctarius2k
Human Readability, Concise
www.hazelcast.com@noctarius2k
Human Readability, Concise
base64 encoded image
www.hazelcast.com@noctarius2k
Human Readability, Concise
Does not play “well”
with binary data :-(
base64 encoded image
www.hazelcast.com@noctarius2k
But let’s be honest…
www.hazelcast.com@noctarius2k
…do we need to store human readable?
www.hazelcast.com@noctarius2k
Binary but understandable!
www.hazelcast.com@noctarius2k
So what’s the next evolution step?
www.hazelcast.com@noctarius2k
C(oncise) B(inary) O(bject) R(epresentation)
www.hazelcast.com@noctarius2k
Features
• Stores JSON-alike content
• Extremely concise
• Binary
• Streamable
• Type safe
• Schemaless
• Highly Extensible
• Well defined specification
• Standard (by the IETF, RFC7049)
www.hazelcast.com@noctarius2k
Real World (Size) Example
www.pathway-game.com
• Stores Geometry Information
• Mainly Float Data
• Often floatToIntBits for Speed
• Lots of Sequences
• Only a few Dictionaries
Really simple data structure
www.hazelcast.com@noctarius2k
Real World (Size) Example
2250000
4500000
6750000
9000000
XML JSON BSON CBOR MSGPACK
MSGPACK

CBOR
BSON
JSON
XML
1.408.737 bytes
1.415.215 bytes
5.575.783 bytes
5.755.188 bytes
8.592.541 bytes
1.0x
1.0x
3.9x
4.0x
6.0x
www.hazelcast.com@noctarius2k
Debugging capability built-in
Dictionary [
ByteString{ ANI0 }=Sequence [
Sequence [
UInt{ 7264 },
UInt{ 4 },
UInt{ 2724 },
UInt{ 37 },
Sequence [
NInt{ -1053818880 },
UInt{ 1077214225 },
UInt{ 0 },
UInt{ 0 },
UInt{ 1068825617 },
]
]
]
]
Since items carry their type information,
writing a quick debugger or using the
provided to-string capabilities of libs
www.hazelcast.com@noctarius2k
Implementations
• JavaScript
• browser
• node.js
• Julia
• C#
• Java
• Lua
• PHP
• Python
• Go
• C
• C++
• Rust
• Perl
• Ruby
• D
• Swift
• Erlang
• Elixir
www.hazelcast.com@noctarius2k
Implementations
• JavaScript
• browser
• node.js
• Julia
• C#
• Java
• Lua
• PHP
• Python
• Go
• C
• C++
• Rust
• Perl
• Ruby
• D
• Swift
• Erlang
• Elixir
CBOR-java:

https://github.com/peteroupc/CBOR-Java
Jackson Dataformat:
https://github.com/FasterXML/jackson-dataformat-cbor
cbor-java:
https://github.com/c-rack/cbor-java
JACOB:
https://github.com/jawi/jacob
borabora:
https://github.com/noctarius/borabora
www.hazelcast.com@noctarius2k
Implementations
• JavaScript
• browser
• node.js
• Julia
• C#
• Java
• Lua
• PHP
• Python
• Go
• C
• C++
• Rust
• Perl
• Ruby
• D
• Swift
• Erlang
• Elixir
CBOR-java:

https://github.com/peteroupc/CBOR-Java
Jackson Dataformat:
https://github.com/FasterXML/jackson-dataformat-cbor
cbor-java:
https://github.com/c-rack/cbor-java
JACOB:
https://github.com/jawi/jacob
borabora:
https://github.com/noctarius/borabora
www.hazelcast.com@noctarius2k
borabora
•Skip-scan parser
•Simple, fluent API
•Supports object queries
•Reading + writing
•Supports mutating (hacky prototype)
•Extended datatype support
www.hazelcast.com@noctarius2k
borabora
•Skip-scan parser
•Simple, fluent API
•Supports object queries
•Reading + writing
•Supports mutating (hacky prototype)
•Extended datatype support
Not just a blur of color
www.hazelcast.com@noctarius2k
borabora
•Skip-scan parser
•Simple, fluent API
•Supports object queries
•Reading + writing
•Supports mutating (hacky prototype)
•Extended datatype support
but the island ;-)
www.hazelcast.com@noctarius2k
Time for some demos, isn’t it?
www.hazelcast.com@noctarius2k
Comparisons
www.hazelcast.com@noctarius2k
Comparisons
“Alternative Facts”
in the comparisons,
are all fake news!
www.hazelcast.com@noctarius2k
MessagePack
• Extremely concise
• Available in almost every language
• UTF-8 and binary strings
• No map keys datatype restriction
• Schemaless
• Binary
• 32bit size limitation for certain data types
• Specification is concise too (~450 lines)
• No official standard
www.hazelcast.com@noctarius2k
MessagePack
• Extremely concise
• Available in almost every language
• UTF-8 and binary strings
• No map keys datatype restriction
• Schemaless
• Binary
• 32bit size limitation for certain data types
• Specification is concise too (~450 lines)
• No official standard
1:0
2:0
Draw
Draw
Draw
Draw
2:1
2:2
2:3
www.hazelcast.com@noctarius2k
JSON
• Human readable
• Official standard (ECMA-404)
• Subset of JavaScript (strong support)
• Schemaless
• Kind of type safe
• Human readable
• Text-based
• Map keys can be strings only
• Large bytesize
www.hazelcast.com@noctarius2k
• Human readable
• Official standard (ECMA-404)
• Subset of JavaScript (strong support)
• Schemaless
• Kind of type safe
• Human readable
• Text-based
• Map keys can be strings only
• Large bytesize
1:0
Draw
2:0
Draw
Draw
2:1
2:2
2:3
2:4
JSON
www.hazelcast.com@noctarius2k
• Binary
• Available in a lot of languages
• Derived from JSON, interoperability 1+
• Schemaless
• Type safe
• Supports in-place updates
• No official standard
• Extremely concise specification
• Map keys can be strings only
• Large bytesize
BSON
www.hazelcast.com@noctarius2k
• Binary
• Available in a lot of languages
• Derived from JSON, interoperability 1+
• Schemaless
• Type safe
• Supports in-place updates
• No official standard
• Extremely concise specification
• Map keys can be strings only
• Large bytesize
Draw
1:0
2:0
Draw
Draw
3:0
3:1
3:2
3:3
3:4
BSON
www.hazelcast.com@noctarius2k
• Human readable
• Official standard (W3C REC-xml)
• Strong commercial support (e.g. IBM)
• Supported everywhere
• Type safe or schemaless
• Human readable
• Text-based
• Very verbose
• Large bytesize
XML
www.hazelcast.com@noctarius2k
• Human readable
• Official standard (W3C REC-xml)
• Strong commercial support (e.g. IBM)
• Supported everywhere
• Type safe or schemaless
• Human readable
• Text-based
• Very verbose
• Large bytesize
1:0
Draw
2:0
3:0
3:1
3:2
3:3
3:4
3:5
XML
www.hazelcast.com@noctarius2k
More alternatives
Text-based:
• bencode
• YAML
• …
Binary:
• Amazon ION
• Smile
• Apache Thrift
• Apache Avro
• Protobuf
• …
ASCII based encoding, unaffected by endianess, type safe
commonly for configuration, superset of JSON, type safe
skip-scan parsable, type safe, commercial support (Amazon)
based on JSON, property-name back-references
DSL, schema-bound, developed by Facebook, RPC services
DSL, schema-bound, primarily used by Hadoop
DSL, schema-bound, developed by Google, RPC services
www.hazelcast.com@noctarius2k
More information:
• http://cbor.io/
• http://bsonspec.org/
• http://www.json.org/
• https://www.w3.org/TR/REC-xml/
• http://msgpack.org/
• https://github.com/noctarius/borabora
• https://en.wikipedia.org/wiki/Bencode
• https://en.wikipedia.org/wiki/YAML
• https://amznlabs.github.io/ion-docs/
• https://en.wikipedia.org/wiki/Apache_Thrift
• https://en.wikipedia.org/wiki/Apache_Avro
• https://en.wikipedia.org/wiki/Protocol_Buffers
• https://en.wikipedia.org/wiki/Smile_(data_interchange_format)
Thank You!
www.hazelcast.com@noctarius2k
Thank You!
Any Questions?
@noctarius2k
http://www.sourceprojects.org
http://github.com/noctarius
@hazelcast
http://www.hazelcast.com
http://www.hazelcast.org
http://github.com/hazelcast

More Related Content

PPTX
Identity and access management
PPTX
IoT Platforms and Architecture
PDF
Discover AI with Microsoft Azure
PDF
Databricks and Logging in Notebooks
PDF
Beam + Pulsar: Powerful Stream Processing at Scale - Pulsar Summit SF 2022
PPTX
Pandas
PPTX
Singer, Pinterest's Logging Infrastructure
Identity and access management
IoT Platforms and Architecture
Discover AI with Microsoft Azure
Databricks and Logging in Notebooks
Beam + Pulsar: Powerful Stream Processing at Scale - Pulsar Summit SF 2022
Pandas
Singer, Pinterest's Logging Infrastructure

What's hot (20)

PPT
Introduction to Google App Engine
PDF
eBay Architecture
PDF
Blockchain With IoT - Top Blockchain IoT Use Cases
PDF
Identity & Access Management by K. K. Mookhey
PPTX
Identity & access management
PDF
Blockchain, cryptography, and consensus
 
PDF
Overview of blockchain technology and architecture
 
PDF
Vector database
PPTX
Internet of things (IoT) with Azure
PPTX
JINI TECH PPT
PPTX
Blockchain for IoT Security and Privacy: The Case Study of a Smart Home
PDF
Python projects
PPTX
Introduction to Network Security
PPTX
Scala fundamentals
PPTX
Database security
PPTX
What You're Missing With Your Current WAF Provider
PDF
Generative AI
PPTX
API Management in Azure
PPTX
SSO introduction
PDF
Architecting for the Cloud using NetflixOSS - Codemash Workshop
Introduction to Google App Engine
eBay Architecture
Blockchain With IoT - Top Blockchain IoT Use Cases
Identity & Access Management by K. K. Mookhey
Identity & access management
Blockchain, cryptography, and consensus
 
Overview of blockchain technology and architecture
 
Vector database
Internet of things (IoT) with Azure
JINI TECH PPT
Blockchain for IoT Security and Privacy: The Case Study of a Smart Home
Python projects
Introduction to Network Security
Scala fundamentals
Database security
What You're Missing With Your Current WAF Provider
Generative AI
API Management in Azure
SSO introduction
Architecting for the Cloud using NetflixOSS - Codemash Workshop
Ad

Viewers also liked (20)

PDF
Project Panama - Beyond the (JVM) Wall
PDF
The Delivery Hero - A Simpsons As A Service Storyboard
PPTX
The Olivet Discourse
PPTX
Communication skills ppt
PDF
PRODUCT PROJECT REPORT
PDF
Recent rl
PPTX
Syrups and elixirs
PPTX
Presentation – I - NEW PERSPECTIVE ON TRADITIONAL TECHNICAL ANALYSIS PROBLEMS...
PDF
Distributed Computing with Hazelcast - Brazil Tour
PPTX
The Joy Of Labour - Karen Cheah - 26th March 2017
PDF
PRODUCT PROJECT REPORT
PPTX
Mixed Bag Quiz 2
PPTX
PPTX
Partnership design (get start)
PDF
Garbage First Garbage Collector: Where the Rubber Meets the Road!
PPTX
3Com 05-0100-002
PPSX
Presentación 1 clase
PPTX
Actividad 1
PPTX
Actividad 2
PDF
Pb0816t
Project Panama - Beyond the (JVM) Wall
The Delivery Hero - A Simpsons As A Service Storyboard
The Olivet Discourse
Communication skills ppt
PRODUCT PROJECT REPORT
Recent rl
Syrups and elixirs
Presentation – I - NEW PERSPECTIVE ON TRADITIONAL TECHNICAL ANALYSIS PROBLEMS...
Distributed Computing with Hazelcast - Brazil Tour
The Joy Of Labour - Karen Cheah - 26th March 2017
PRODUCT PROJECT REPORT
Mixed Bag Quiz 2
Partnership design (get start)
Garbage First Garbage Collector: Where the Rubber Meets the Road!
3Com 05-0100-002
Presentación 1 clase
Actividad 1
Actividad 2
Pb0816t
Ad

Similar to CBOR - The Better JSON (20)

PDF
Apache Arrow Workshop at VLDB 2019 / BOSS Session
PDF
Extending Flink State Serialization for Better Performance and Smaller Checkp...
PPTX
Google Protocol Buffers
PDF
Jvm goes big_data_sfjava
PDF
FP Days: Down the Clojure Rabbit Hole
PDF
CROCHET - Checkpoint Rollback in JVM (ECOOP 2018)
PPTX
Java Serialization Facts and Fallacies
PDF
Jython
PDF
3 apache-avro
PPTX
Thrift vs Protocol Buffers vs Avro - Biased Comparison
PDF
HBase Data Types
PPTX
Hadoopjsjdkkdkdkdkkdjjjkkkdkkfkfoofofofoofofofkfiif
PDF
Better Software: introduction to good code
PDF
Java collections the force awakens
PDF
Story Writing Byte Serializer in Golang
PPTX
Сергей Моренец. Serialization and performance in Java
PDF
PPTX
C# 6 and 7 and Futures 20180607
PDF
ApacheCon09: Avro
PDF
Data encoding and Metadata for Streams
Apache Arrow Workshop at VLDB 2019 / BOSS Session
Extending Flink State Serialization for Better Performance and Smaller Checkp...
Google Protocol Buffers
Jvm goes big_data_sfjava
FP Days: Down the Clojure Rabbit Hole
CROCHET - Checkpoint Rollback in JVM (ECOOP 2018)
Java Serialization Facts and Fallacies
Jython
3 apache-avro
Thrift vs Protocol Buffers vs Avro - Biased Comparison
HBase Data Types
Hadoopjsjdkkdkdkdkkdjjjkkkdkkfkfoofofofoofofofkfiif
Better Software: introduction to good code
Java collections the force awakens
Story Writing Byte Serializer in Golang
Сергей Моренец. Serialization and performance in Java
C# 6 and 7 and Futures 20180607
ApacheCon09: Avro
Data encoding and Metadata for Streams

More from Christoph Engelbert (20)

PDF
Postgres on Kubernetes - Dos and Donts.pdf
PDF
Data Pipeline Plumbing
PDF
Gute Nachrichten, Schlechte Nachrichten
PDF
Of Farm Topologies and Time-Series Data
PDF
What I learned about IoT Security ... and why it's so hard!
PDF
PostgreSQL: The Time-Series Database You (Actually) Want
PDF
Road to (Enterprise) Observability
PDF
Oops-Less Operation
PDF
Instan(t)a-neous Monitoring
PDF
Don't Go, Java!
PDF
TypeScript Go(es) Embedded
PDF
Hazelcast Jet - Riding the Jet Streams
PDF
A Post-Apocalyptic sun.misc.Unsafe World
PDF
Gimme Caching - The JCache Way
PDF
In-Memory Computing - Distributed Systems - Devoxx UK 2015
PDF
In-Memory Distributed Computing - Porto Tech Hub
PDF
JCache - Gimme Caching - JavaLand
PDF
Distributed Computing - An Interactive Introduction
PDF
Gimme Caching - The JCache Way
PDF
Gimme Caching, the Hazelcast JCache Way
Postgres on Kubernetes - Dos and Donts.pdf
Data Pipeline Plumbing
Gute Nachrichten, Schlechte Nachrichten
Of Farm Topologies and Time-Series Data
What I learned about IoT Security ... and why it's so hard!
PostgreSQL: The Time-Series Database You (Actually) Want
Road to (Enterprise) Observability
Oops-Less Operation
Instan(t)a-neous Monitoring
Don't Go, Java!
TypeScript Go(es) Embedded
Hazelcast Jet - Riding the Jet Streams
A Post-Apocalyptic sun.misc.Unsafe World
Gimme Caching - The JCache Way
In-Memory Computing - Distributed Systems - Devoxx UK 2015
In-Memory Distributed Computing - Porto Tech Hub
JCache - Gimme Caching - JavaLand
Distributed Computing - An Interactive Introduction
Gimme Caching - The JCache Way
Gimme Caching, the Hazelcast JCache Way

Recently uploaded (20)

PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
A novel scalable deep ensemble learning framework for big data classification...
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Getting started with AI Agents and Multi-Agent Systems
PDF
Architecture types and enterprise applications.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Enhancing emotion recognition model for a student engagement use case through...
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
1 - Historical Antecedents, Social Consideration.pdf
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
DP Operators-handbook-extract for the Mautical Institute
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
A novel scalable deep ensemble learning framework for big data classification...
Group 1 Presentation -Planning and Decision Making .pptx
Module 1.ppt Iot fundamentals and Architecture
WOOl fibre morphology and structure.pdf for textiles
A contest of sentiment analysis: k-nearest neighbor versus neural network
cloud_computing_Infrastucture_as_cloud_p
Getting started with AI Agents and Multi-Agent Systems
Architecture types and enterprise applications.pdf
Assigned Numbers - 2025 - Bluetooth® Document
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Enhancing emotion recognition model for a student engagement use case through...
Programs and apps: productivity, graphics, security and other tools
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
1 - Historical Antecedents, Social Consideration.pdf
O2C Customer Invoices to Receipt V15A.pptx
Final SEM Unit 1 for mit wpu at pune .pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
DP Operators-handbook-extract for the Mautical Institute

CBOR - The Better JSON