Introduction to MongoDB NoSQL database for SQL Developers – Part 1

Note: This series is the first part of a collection of post depicting MongoDB NoSQL database key features and functionality. Further posts can be found HERE (part 2), HERE (part 3) and HERE (part 4).

Introduction

Coming from mainly relational database background, NoSQL movement seemed like a bit of a fad when it first started making rounds in the early 2000 and my immediate though was that perhaps with the exception of a few hippy Silicon Valley startups, it will end up being just a flash in the pan. It is 2014 and it turns out that not only has it proven to be a viable data storage solution for many enterprise-level and beyond (don’t know how one would refer to the likes of Google or Amazon) companies but it has been slowly making inroads into more conservative environments, where long-term reliance on RDBMSs from vendors such as Oracle, IBM or Microsoft seemed undisturbed.

Working in IT, it has been both, a curse and an asset to see changes proliferation throughout the industry, with new programing languages and frameworks popping up like wild mushrooms. However, for a typical database professional, since the inception of Codd’s famous relational model, things have been pretty steady for quite some time. SQL language has been the golden standard for all major database vendors and providing one could master basic methodologies and principles of database development and management, working as a DBA or database developer has been a steady and nonfluctuating field to be in. That’s until recently. Not long ago I wrote about the new data (warehouse) management frontier emerging in a form of a cloud deployment (link HERE). In this post I would like to explore one variant of the NoSQL databases plethora – document-oriented MongoDB.

MongoDB Database Characteristics

A quick Wikipedia lookup under NoSQL outlines a rich ecosystem of NoSQL database with some major categories such as column, key-value, document or graph database. MongoDB falls under document-oriented database, characterised by high performance, scalability and flexibility and low complexity and variable functionality. MongoDB is a free and open-source software and has been adopted as backend database by a number of major websites and services, including Craigslist, eBay, Foursquare, SourceForge, and The New York Times, among others. Main features include indexing support, MapReduce support for batch processing of data and aggregation operations, file storage as well as built-in replication and load balancing. Programmatic access is available in a number of languages such as C, C++, C#, Erlang, Java, Python, Ruby, and more.

MongoDB makes it (arguably) easy for someone accustomed to thinking in terms of tables, columns and rows as the mapping between those is quite straightforward. A ‘table’, represented in relational terms, equals to a ‘collection’ in MongoDB whereas a ‘row’ is represented by a ‘document’; everything else i.e. database, indexes, primary keys etc. definitions tend to overlap with few distinct differences. Another distinct feature is the fact that MongoDB is a schema-less database – a document’s key and values are not fixed types or sizes, therefore adding and removing fields (columns) becomes easier.

Finally, queries executed on MongoDB follow different syntax rules then those created using declarative SQL. MongoDB, by default, uses JSON-style notation which can be quite confusing at first attempt, regardless of your SQL expertise level. There have been a number of projects to simplify or standardise querying NoSQL data stores and few services exist where you can parse SQL query to have it converted into MongoDB syntax e.g. HERE, however, for me personally, it was easier to pick up MDX or DMX (languages used for OLAP and data mining queries) which by virtue of their syntax were quite a departure from my comfort zone i.e. ‘classic’ SQL, then to run with MongoDB native query implementation structure. That’s not to say that with a little bit of persistence and time it cannot be mastered; additionally, an occasional paradigm shift from the archetypical SQL provides a breath of fresh to otherwise very conventional field.

MongoDB Database Installation Overview

Without further ado let’s look at MongoDB in more detail. In this video I will show you how to download, install and perform basic configuration on a MongoDB instance.

Also, if you’re interested in Mongo’s query syntax essentials and would like to use it with something a little bit less primitive then the console window, please check out the remaining three posts to this series HERE (part 2), HERE (part 3) and HERE (part 4).

http://scuttle.org/bookmarks.php/pass?action=add

Tags: , ,

This entry was posted on Thursday, January 30th, 2014 at 12:55 am and is filed under NoSQL, SQL. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply