Programming since the crib ‣ Interested in digital creativity ‣ CompSci + Human Computer Interaction ‣ I run 2draw.net, online drawing tools + art community ‣ Current project: html5 sketching with websockets
= require("mongolian") var server = new Mongolian var posts = server.db("awesome_blog").collection("posts") posts.insert({ pageId: "hallo", created: new Date, body: "Welcome to my new blog!" }) posts.findOne({ pageId:"hallo" }, function(error, post) { ... }) posts.find().limit(5).sort({ created:1 }).toArray(function (error, array) { ... })
with nesting and code overhead ‣ Numerous differences from the mongo shell API ‣ Port of the ruby driver, not node.js-centric ‣ Not much documentation ‣ GridFS support clunky—didn’t use node.js IO streams
Started by adding stream support to mongodb-native’s GridFS ‣ Wrapped mongodb-native with a mongo shell-style API ‣ In March 2011, the wrapper became Mongolian 0.1.0 ‣ Good excuse to learn node.js, modules, and mongodb’s intimates
mongodb-native’s internal APIs creates churn ‣ Bugs in mongodb-native look like bugs in Mongolian ‣ Mongolian no longer felt like a wrapper ‣ The dependency was becoming a burden...
buffalo: pure node.js BSON serializer/parser ‣ https://github.com/marcello3d/node-buffalo ‣ Initially, 20~30% faster ‣ No longer depending on mongodb-native ‣ 4k LOC vs 14k LOC
a library: need a library ‣ Focus on the user experience ‣ Write for yourself, don’t over-generalize ‣ What is the minimal feature set? ‣ Start with the most important pieces, fill in the rest later (if needed) ‣ Be simple and consistent!
‣ Use it! https://github.com/marcello3d/node-mongolian ‣ More mongo server command coverage ‣ Connection pooling, slave reads, tailable cursors ‣ Production testing ‣ Benchmarking, profiling, and optimization ‣ Fork and contribute!