Escape the ‘RM’ in ORM using MongoDB

Last week we hit the customary ORM wall when we had to model a Many-To-Many relationship in our domain model. Even with Castle ActiveRecord we were still being forced to create either association table on the database schema, or an equivalent class to leverage ActiveRecord’s automatic schema creation. Added on top the need to manage SQL Server instances, we decided to take a fresh look at storage options that will allow us to continue coding with minimal friction on persistance.

Getting a cue from a former colleague at ThoughtWork, I started looking into the NoSQL movement. MongoDB seems to be getting a fair amount of press recently so I decided to try it out. Using NoRM as the .Net driver for MongoDB, I was able to covert our (still very small) codebase from using ActiveRecord to MongoDB in about 2 hours.

The process was made easier by our use of Repository pattern so most of the changes are concentrated in all the repositories methods (CRUD and queries). One potential side benefit is that because MongoDB is so fast, it is now possible to test data queries along side regular unit tests with minimal cost in time. This is generally not possible with RDBMS data storage.

* One of the useful tip I’ve come across is how to run MongoDB as Windows service.

What do you do?

I don't often met new people and thus question of what I do does not pop up this frequently. But it has been hard to describe what I do to people who are not in the software development community since the first day I started my first job. Normally I just say I am a software developer and that tends to put most people off since they don't understand software at all. To them software is a black box, it is magic, it is voodoo. But every now and then there will be someone who does a bit of Visual Basic Scripting in the office and thinks s/he knows software development. This person would then try to probe deeper about what I actually do. In that situation, I'd have no mercy and just tell the person exactly what I do. 99.99% of the time, eyes would glazed over within 10 seconds and conversation would die as soon as I finish my sentence.

Recently my father-in-law asked me about my current project (via my wife). Note that he is a software project manager so I did not filter/dumb down my response. My reply is below and if you understand what I am talking about, give me a shout; ThoughtWorks is looking for someone like you!

We are developing the build & deploy system for the whole enterprise. That is, a system that allows in-house developers to build their applications and deploy the applications to the machines. Sounds simple but we are also implementing Continuous Integration concept using build servers, trigger off source control checkins. (The main reason ThoughtWorks was brought in as we are known in the industry as build expert, re: CruiseControl)

We are also solving their source and binary dependency problem so applications would be self-contained when they are built, tested, and packaged by the build server. The deployment/install process would allow environment specific properties to be substitute during deploy time so packages can be deployed to multiple environments without going through the build process again. (Build once, deploy everywhere)

Deployment process also includes workflow steps to manage code review/gatekeeper approvals, security audits, and code signing.

All of these are built with extensibility in mind so future technology, such as Ruby, IronPython, can be introduced into the organization via plugins with minimum alteration to the system.

In addition, we are also advising the client on code branching and merging strategy, best development and unit testing practices, dependency management, database upgrades (model and data) using delta scripts, etc.

Read and post comments |
Send to a friend

Create a free website or blog at

Up ↑

%d bloggers like this: