Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Putting the GO in MongoDB

Putting the GO in MongoDB

A talk, made by Wisdom Omuya, about the rewrite of the MongoDB CLI tools for version 3.0 using the Go programming language.

Presented by me at the 6th MongoDB Belgium meetup. After Wisdom and I went through it during a 1-on-1 call

Hannes Van De Vreken

June 16, 2015
Tweet

More Decks by Hannes Van De Vreken

Other Decks in Technology

Transcript

  1. Invalid Documents • Nested CSV, TSV imports { "_id": ObjectId("5542593837096bdf8bbb6d91"),

    "name.first": "Hannes", "name.last": "Van De Vreken" } name.first,name.last Hannes,Van De Vreken
  2. mongo> db.test.find({"name.first": "Wisdom"}) Fetched 0 record(s) in 0ms Unretrievable Data

    { "_id": ObjectId("5542593837096bdf8bbb6d91"), "name.first": "Hannes", "name.last": "Van De Vreken" }
  3. General • Storage engine support • Wiredtiger, RocksDB, etc •

    Backwards compatibility • Dump and restore BSON • Import and export JSON
  4. • Excellent support for concurrency • Runs on all supported

    platforms • Easier to write and debug • Fun! Why Go?
  5. New Mongoimport Flags --numDecodingWorkers (autodetect to max) --numInsertionWorkers (default 1)

    --batchSize (default 10k) --numThreads (autodetect to max) --maintainInsertionOrder (default false)
  6. Dot-nesting • Nested CSV, TSV imports { "_id": ObjectId("5542593837096bdf8bbb6d91"), "name":

    { "first": "Hannes", "last": "Van De Vreken" } } name.first,name.last Hannes,Van De Vreken
  7. Write Concern Specificity • New default w=majority on import/restore/files o

    safer, matches what our users assume is happening • --writeConcern flag e.g. ‘{w: 3, j: true, fsync: false, wtimeout: 400}’
  8. What’s next? • mongorestore and mongodump now support compression and

    archiving • No need for directories containing BSON files mongodump -d weather -h localhost --archive --gzip | mongorestore -h remotehost --archive --gzip