Yesterday's meeting covered
a lot. I'll be going more into depth about pretty much everything in future meetings, so don't worry if you didn't catch it all or some things didn't make sense.
First, if you weren't there last night, I got an email from Conde Nast (publishers of Vogue, Reddit, The New Yorker, etc.) who want to move a project using MongoDB with the Node.js driver into production, but can't until replica set support is implemented. So, that's our first task! There was going to be a more gradual intro to all of these tools over a couple weeks, but now you guys need to be up and running ASAP, so we're going to jump right in.
Stuff to installThings you should get set up/installed ASAP:
As you may have noticed from the instructions above, things will be easier if you can use Linux or OS X instead of
Windows.
To learn to use these tools:
The Node.js driverGet the code we'll be working on (the Node.js driver):
- Go to http://github.com/kchodorow-corp/node-mongodb-native and click the "fork" button in the upper-right corner.
- In a terminal, run "git clone g...@github.com:your-username/node-mongodb-native.git". Replace your-username with whatever you chose as a username when you signed up for a github account.
- Now you'll have a directory called node-mongodb-native. This is where the driver's code resides. Change to this directory.
- Run make.
- The source we're mostly concerned about is in lib/mongodb.
Replica setsLearn what replica sets are:
http://www.mongodb.org/display/DOCS/Replica+Sets. Try setting them up locally:
http://www.snailinaturtleneck.com/blog/2010/07/30/replica-sets-part-1-master-slave-is-so-2009/. Replica set support for the Node.js driver can be broken down into:
- Create a replica set connection class in connection.js
- On connection, figure out all members of a set and connect to the master.
- If the driver gets disconnected or gets a "not master" message from the database, it needs to use the list of hosts to figure out who the new master is.
A good way of doing this is probably to look at the driver for a language you're familiar with and copy what they do. See
http://github.com/mongodb to get the source for various language drivers.
Other things that need doing- Documentation! Pretty much nothing in lib/mongodb is documented. We'll be using jsdoc toolkit format documentation, see http://code.google.com/p/jsdoc-toolkit/w/list for instructions on documenting JS. Figure out how the driver works and document it.
- Try running the examples in the examples/ directory (see the README for instructions on how). They didn't work for me, if they don't work for you, fix them so they do!
- Once there is a replica set class implemented in the driver, it'll need to be tested out the wazoo.
- Try to answer questions on the node-mongodb mailing list.
ConclusionI know that this is a huge list of non-trivial things to do. All I can say is that it's totally worth it: contributing to an open source project is one of the most rewarding things in the world. If you can slog through the setup, you've done all the unfun stuff. Good luck and please ask questions.
Please also feel free to stop by the 10gen offices at 17 West 18th Street any Wednesday from 4-7. We can hack on the driver and I can answer questions. Our next meeting at NYU will be October 18th.