Linked by Thom Holwerda on Wed 25th Jan 2012 22:05 UTC, submitted by twitterfire
Permalink for comment 504812
To read all comments associated with this story, please click here.
To read all comments associated with this story, please click here.
Features
Linked by Thom Holwerda on 06/13/13 14:35 UTC
Linked by Thom Holwerda on 06/11/13 17:07 UTC
Linked by Thom Holwerda on 06/10/13 23:13 UTC
Linked by Thom Holwerda on 06/08/13 14:57 UTC
Linked by Thom Holwerda on 06/07/13 11:40 UTC
Linked by Thom Holwerda on 06/04/13 12:45 UTC
Linked by nfeske on 05/31/13 10:12 UTC
Linked by Thom Holwerda on 05/29/13 16:59 UTC
Linked by Thom Holwerda on 05/24/13 17:26 UTC
Linked by Thom Holwerda on 05/21/13 21:38 UTC
More Features »
Sponsored Links



Member since:
2011-01-28
Zifre,
This is the first time I've heard of BSON. I see the mongodb project came up with it.
http://bsonspec.org/#/specification
I read the spec, and to be honest I don't like some of the design choices they made. Some of the datatypes are fixed size, some strings are zero terminated, others have a length prefix, yet another has both a length prefix and is zero terminated (I haven't the foggiest idea why?).
Whereas JSON encapsulates only primary generic datatypes, BSON has started enumerating application specific datatypes like MD5, RegEx, and UUID.
{"Name": "Alfman", "MD5": (string)"md5bytes"}
{"Name": "Alfman", "MD5": (Generic)"md5bytes"}
{"Name": "Alfman", "MD5": (User)"md5bytes"}
{"Name": "Alfman", "MD5": (MD5)"md5bytes"}
{"Name": "Alfman", "MD5": (RegEx)"md5bytes"}
{"Name": "Alfman", "MD5": (UUID)"md5bytes"}
In my opinion this is fundamentally flawed:
Problem 1: Application specific datatypes don't deserve special treatment in a generic transport protocol. Why is SHA not present? What about RSA keys? What about a JPEG datatype?
Problem 2: The *meaning* of a variable is implicitly known by the code which uses it. If it's *expecting* the MD5 field to contain an MD5 hash, there's no need for the transport protocol to tell it that the raw bytes are an MD5 datatype. JSON/XML work fine this way, I can't think of many applications that would benefit from overloading the MD5 field into different datatypes, which is probably always going to be an error.
So in my opinion, BSON is not a good model for a binary HTTP protocol. But I do think a simple binary name/value collection could work nicely.
Edit: it has occurred to me that you didn't actually propose BSON would be suitable for HTTP, but merely used it as an example of a binary container. So maybe my reply is out of context to what you were thinking, but I'll leave my comments anyway.
Edited 2012-01-27 03:27 UTC