2 ms·
There are main three design trade-offs in the space of serialization protocols (even ignoring RPC): 1. Do you want an efficient format (i.e. binary) or a forma
by js8 10y ago
There are main three design trade-offs in the space of serialization protocols (even ignoring RPC):
1. Do you want an efficient format (i.e. binary) or a format that is easily readable/writable by humans (i.e. text)?
2. Do you want self-describing format (data schema is part of the standard) or schema-less format, to save space on transmission? And how much?
3. How to deal with mixed text data? Do you want primarily to store strings and escape any structured data within them (a la XML), or do you want to primarily store structured data and force all text to be escaped in them (a la JSON).
Personally, I like CBOR, which interestingly wasn't mentioned.
- twic 10y ago4. Do you want to optimise for space (in which case use variable-length integers) or speed of parsing (in which case use fixed-length integers)? The speed of parsing case is definitely rare, but i've done some work where packets come in off a 10-gig ethernet port, and every nanosecond counts.