The MongoDB NoSQL Database Blog

Month

May 2009

2 posts

BSON

MongoDB stores documents (objects) in a format called BSON.  BSON is a binary serialization of JSON-like documents. BSON stands for “Binary JSON”, but also  contains extensions that allow representation of data types that are not part of JSON.  For example, BSON has a Date data type and BinData type.

The MongoDB client drivers perform the serialization and unserialization.  For a given language, the driver performs translation from the language’s “object” (ordered associative array) data representation to BSON, and back. While the client performs this work, the database understands the internals of the format and can “reach into” BSON objects when appropriate: for example to build index keys, or to match an object against a query expression.  That is to say, MongoDB is not just a blob store.

Thus, BSON is a language independent data interchange format.

The BSON serialization code from any MongoDB driver can be used to serialize and unserialize BSON, even for applications where the Mongo database proper is completely uninvolved.  This usage is encouraged and we would be happy to work with others on making the format as generically useful as possible.

Other Formats

The key advantage over XML and JSON is efficiency (both in space and compute time), as it is a binary format.

BSON can be compared to binary interchange formats, such as Protocol Buffers.  BSON is more “schemaless” than Protocol Buffers — this being both an advantage in flexibility, and a slight disadvantage in space as BSON has a little overhead for fieldnames within the serialized BSON data.

See Also

BSON Specification

May 28, 20096 notes
#bson #best of #binary #json
The AGPL

MongoDB is released under the GNU Affero General Public License.  This Free Software Foundation license is fairly new, and thus we wanted to talk about how this license differs from GPL.

Our goal with using AGPL is to preserve the concept of copyleft with MongoDB.  With traditional GPL, copyleft was associated with the concept of distribution of software.  The problem is that nowadays, distribution of software is rare: things tend to run in the cloud.  AGPL fixes this “loophole” in GPL by saying that if you use the software over a network, you are bound by the copyleft.  Other than that, the license is virtually the same as GPL v3.

To say this another way: if you modify the core database source code, the goal is that you have to contribute those modifications back to the community.

Note however that it is NOT required that applications using mongo be published.  The copyleft applies only to the mongod and mongos database programs.  This is why Mongo DB drivers are all licensed under an Apache license.  You application, even though it talks to the database, is a separate program and “work”.

As always, we want your feedback (and participation) — comments welcome both here and in the forums.

May 5, 20095 notes
#agpl
Next page →
2012 2013
  • January 3
  • February 1
  • March 4
  • April 3
  • May 5
  • June 3
  • July
  • August
  • September
  • October
  • November
  • December
2011 2012 2013
  • January 1
  • February 1
  • March
  • April 2
  • May 4
  • June 5
  • July 8
  • August 10
  • September 5
  • October 8
  • November 7
  • December 5
2010 2011 2012
  • January 1
  • February
  • March 2
  • April 2
  • May 3
  • June 3
  • July 2
  • August 1
  • September 3
  • October 1
  • November 1
  • December 2
2009 2010 2011
  • January 1
  • February 6
  • March 12
  • April 6
  • May 3
  • June 3
  • July 1
  • August 1
  • September 1
  • October
  • November
  • December 1
2009 2010
  • January 1
  • February
  • March
  • April 4
  • May 2
  • June 3
  • July 5
  • August 6
  • September 2
  • October 3
  • November 4
  • December 2