Accueil > professional > mongoBD: 9 months on – the good

mongoBD: 9 months on – the good

Article part of my « mongoDB 9 months » series:

The good

Document orientation rocks

mongoDB is document oriented. It means its tables, named collections, contain documents, which themselves are kind of loosely defined.

Indeed, instead of having one definition of the structure for the whole collection, each document embeds its own description, in a hierarchical form. The various documents’ hierarchy descriptions don’t have to match at all. In fact, each document in the same collection could have a completely different hierarchy. However, for consistency sake and querying, they usually share some common structure, even if every document can diverge at any point.

This « document definition » is done through JSON data, so key value pairs which can be nested. For example, it can be something like this:


{ author: 'clueless joe',
  created : new Date('04/10/2011'),
  title : 'Yet another blog post',
  text : 'Here is the text...',
  tags : [ 'example', 'joe' ],
  comments : [ { author: 'jim', comment: 'I disagree' },
              { author: 'nancy', comment: 'Good post' }
  ]
}

The square brackets represent a collection.

Overall, the document approach really feels like a perfect mapping for the Aggregate root pattern of Domain Driven Design. As such, related elements are put all together, without dispersion around the database like proper database normalisation would often dictate.

As such, the mapping is potentially very close from your application server side data representation, even if it differs slightly in some parts. Relationships are also way less an issue: most of them are now directly put in the document itself, either through some list or even map. One doesn’t have any more to wonder where to put this lazy relationship and the like: being part of the same document, they’re all loaded together by default, in one non expensive query. Similarly, no issue with sorted content and the like: it’s just a matter of writing the data down in the proper order. In the end, writing a document is really a breeze and is done quickly.

Furthermore, mongoDB queries are really flexible and able to pick up only the documents with the relevant structure and content. One doesn’t have to care for missing part of the structure: these will just be skipped. Writing queries ends up being quite easy, once the syntax becomes familiar.

All in all, this document approach feels like able to reasonably match Object Oriented Design, getting way fewer in the way than traditional RDBMS.

Fast evolution

mongoDB is evolving fast. In 9 months, I think we moved from version 1.6 to 1.8, as well as 2.2 to 2.5 for the Java Driver.

This means lot of new features where added, some of which we made good use in between, which is always good.

Even more important, it shows that 10gen sticks to its words of fast paced development, which is especially nice since they’re considering new features rather frequently, when need arise.

In a broader view, 10gen puts a lot of effort into mongoDB, from the worldwide conferences to the mailing list and support, which is really nice.

As you might guess, though, it’s not all rosy: announce, communication and documentation of new features are sometimes lacking. Similarly, the scope of mongoDB extends each time a bit, making harder to get a proper full picture, especially since I haven’t some « roadmap-ish » kind of document (at least to my knowledge) which would help to figure out where it’s heading. For example, I discovered a lot of upcoming stuff when digging in for this article, mostly from the Jira. I would prefer them to be as well summed up somewhere…

Overall, though, I still think this fast paced development is good and makes me able to trust the mongoDB staff when they say something will come in some later release: it won’t be after I’m dead ;).

The mongoDB 9 months on series continues: The bad – hurdles which could/should be fixed.

Publicités
Étiquettes : , , ,
  1. Aucun commentaire pour l’instant.
  1. No trackbacks yet.

Laisser un commentaire

Entrez vos coordonnées ci-dessous ou cliquez sur une icône pour vous connecter:

Logo WordPress.com

Vous commentez à l'aide de votre compte WordPress.com. Déconnexion / Changer )

Image Twitter

Vous commentez à l'aide de votre compte Twitter. Déconnexion / Changer )

Photo Facebook

Vous commentez à l'aide de votre compte Facebook. Déconnexion / Changer )

Photo Google+

Vous commentez à l'aide de votre compte Google+. Déconnexion / Changer )

Connexion à %s

%d blogueurs aiment cette page :