
Thoughts going into this:
Not quite.
Gzip from the client to server is not recommended. https://stackoverflow.com/a/48572297

There be dragons binary
The following string representations are only for visualization purposes.
Something(Bwidgetscogs
const example1K = avro.Type.forSchema({
type: 'record',
fields: [
{ name: 'id', type: 'string' },
{ name: 'index', type: 'int' },
{ name: 'guid', type: 'string' },
{ name: 'isActive', type: 'boolean' },
{ name: 'balance', type: 'string' },
{ name: 'picture', type: 'string' },
{ name: 'age', type: 'int' },
{ name: 'eyeColor', type: 'string' },
{ name: 'name', type: 'string' },
{ name: 'gender', type: 'string' },
{ name: 'company', type: 'string' },
{ name: 'email', type: 'string' },
{ name: 'phone', type: 'string' },
{ name: 'address', type: 'string' },
{ name: 'about', type: 'string' },
{ name: 'registered', type: 'string' },
{ name: 'latitude', type: 'float' },
{ name: 'longitude', type: 'float' },
{ name: 'greeting', type: 'string' },
{ name: 'favoriteFruit', type: 'string' },
{ name: 'tags', type: {type: 'array', items: 'string'} },
{
name: 'friends',
type: {
type: 'array',
items: {
type: 'record',
fields: [
{ name: 'id', type: 'int'},
{ name: 'name', type: 'string'},
]
}
}
},
]
});https://en.wikipedia.org/wiki/Bencode
d8:contentsl7:widgets4:cogse4:name9:Something6:weighti42ee
Oname
Somethingweight*contents 0widgets1cogs
https://msgpack.org/index.html
��name�Something�weight*�contents��widgets�cogs
https://developers.google.com/protocol-buffers/
Something(Bwidgetscogs
const root = protobuf.Root.fromJSON({
nested: {
Friend: {
fields: {
id: {
type: 'int32',
id: 1,
},
name: {
type: 'string',
id: 2,
},
}
},
Example: {
fields: {
// Primary
id: {
type: 'string',
id: 1,
},
index: {
type: 'int32',
id: 2,
},
guid: {
type: 'string',
id: 3,
},
// Non-Primary
isActive: {
type: 'bool',
id: 20,
},
balance: {
type: 'string',
id: 21,
},
picture: {
type: 'string',
id: 22,
},
age: {
type: 'int32',
id: 23,
},
eyeColor: {
type: 'string',
id: 24,
},
name: {
type: 'string',
id: 25,
},
gender: {
type: 'string',
id: 26,
},
company: {
type: 'string',
id: 27,
},
email: {
type: 'string',
id: 28,
},
phone: {
type: 'string',
id: 29,
},
address: {
type: 'string',
id: 30,
},
about: {
type: 'string',
id: 31,
},
registered: {
type: 'string',
id: 32,
},
latitude: {
type: 'float',
id: 33,
},
longitude: {
type: 'float',
id: 34,
},
tags: {
type: 'string',
id: 35,
rule: 'repeated'
},
friends: {
id: 36,
rule: 'repeated',
type: 'Friend'
},
greeting: {
type: 'string',
id: 37,
},
favoriteFruit: {
type: 'string',
id: 38,
},
}
},
Examples: {
fields: {
data: {
type: 'Example',
id: 1,
rule: 'repeated'
}
}
}
}
});


Nothing beats JSON

You can save 8% with Avro (after gzip)

You can save up to ~30% with Avro
but that data is free anyway
Data is not free for the user (in most cases)