2. How it Works
http://www.flickr.com/photos/tmh9/677919415/
3. BSON
{“hello”: “bson”}
x15 x00 x00 x00 x02 h e
l l o x00 x05 x00 x00
x00 b s o n x00 x00
http://bsonspec.org
4. Messages
• TCP/IP Wire Protocol
• Separate messages for
insert, update, query, get_more, delete, etc.
http://www.mongodb.org/display/DOCS/Mongo+Wire+Protocol
5. Anatomy of an insert
use foo;
db.test.insert({“hello”: “bson”});
message length request id response id op code (insert)
x67x00x00x0 xXXxXXxXX x00x00x00x xd2x07x00x00
0 xXX 00
reserved collection name document(s)
x00x00x00x00 f o o . t e s t x00 BSON({“hello”: “bson”})
http://www.mongodb.org/display/DOCS/Mongo+Wire+Protocol