When I first saw NoSQL stores a few years ago I wasn’t that impressed. They were nice and really fast if you had a bucket load of ram, but it seemed to be a solution to a problem I didn’t have.
My biggest qualm was initially the “eventually consistent” data, and the absolute requirement to have multiple nodes. I have grown to like the ”eventually consistent” model because 75% of what I build are CMS or CRUD type apps. With these type of apps you are reading data most of the time and only occasionally writing to the store.
But, for the most part good old MySQL serves as the warhorse as it has with me for the last 12 years (wow, it’s been that long?!). It does the job, and doesn’t take a lot of admin to keep things running smoothly.
MongoDB – The new cool?
But recently I began to hear about MongoDB, and I’ve really taken a shine to it. Essentially it is a NoSQL datastore, but stores data as binary JSON (BSON) but seems to straddle the divide between traditional RDBMS & NoSQL stores. It also has full index support, journaling, really nice support for replication and sharding and pretty much all the things you’d expect of a RDBMS but in a document store with a number of extra bells and whistles attached.
There also seems to be a lot of energy in the project, and it feels like MySQL did when it was the scrappy newcomer (but Mongo has a *much* better website!).
Schema-me-this, schema-me-that
But the one thing I can’t quite understand yet is how to model a document store schema. Document stores can be multi-dimensional, which means that you can store arrays, structs and all manner of data nested within a single document record. This can be very useful, but traditional normalisation rules do not apply.
I’ve had CODDs normalisation drummed into my brain so much it is just nature to me now; I go all the way to 5NF ’cos I’m hard.
Changing you mindset after 15+ years of BCNF dogma is a tricky thing, and I think it requires the kind of mind-shift that I had to go through when learning OOP having only used functional languages before.
The problem is that there I have not uncovered as yet a wealth of information on what the best way to design these things and as such I’ve not taken the plunge yet with MongoDB as the backbone in a new project.
But yay, enlightenment is a mere 30mins drive away @ LAX
But, the knowledge gods have smiled on me as there is a MongoDB 1day conference in LA on the 19th Jan with a track on just the thing I am craving info on. I will dutifully report what I learn should I remember anything after we inevitably hit the bar (there will be no repeat of Scotch on the Rocks and the Jagermeister incident).
Watch this space…
