20 Jun 2010
MongoUK has been and gone and the day went very well. Many thanks to the 10gen guys who sponsor MongoDB for putting on a great meeting. My head is spinning with thoughts and ideas about MongoDB and the host of possibilities it clearly opens up for many classes of application.
It was interesting to learn that MongoDB was born primarily out of a desire for high performance and horizontal scalability i.e. the ability to scale out to multiple nodes as needed. Other properties such as its non-relational and schema-free nature are happy side effects as joins and the maintenance of referential integrity are difficult in a highly parallel environment. It also explains why there is no strong drive to implement transactions, a feature completely absent from MongoDB which is not only hard to implement in a highly parallel environment but would also be detrimental to performance.
Some stand-out features of MongoDB discussed at the meeting include the following:
- MongoDB is schema free and far more capable than simply storing arbitrary key / value pairs. MongoDB stores BSON documents, a binary JSON format meaning that data of any complexity and nesting can be represented.
- Through the use of BSON, MongoDB understands several basic data types including integers, strings, floating point and datetime. Many similar databases only support strings and perhaps numeric data types usually leaving the developer to do some parsing in their application.
- Indexes can be created at any level of nesting in a document, and significantly, an index can be created on an array. Imagine a database full of objects with nested attributes one of which is an array of tags then rapidly searching for all objects with a given tag.
- A large number of drivers are already developed and well supported.
- MongoDB has extremely rich query support. Apparently the developers considered using SQL as the query language but settled on a JSON query format. The result is an expressive query language which is satisfyingly symmetrical to the nature of the data being queried upon.
In my previous post I hoped to learn whether MongoDB would be a good solution to storing and querying our arbitrary key value data. MongoDB would clearly solve some of our issues and I look forward to putting MongoDB though its paces over the coming days and to assess it with respect to other document-oriented databases.