Blog | Software outsourcing information

How MongoDB Can Help You Create Smarter Web Apps

Written by Andy Hilliard | Aug 21, 2015

There is a recent movement away from relational databases like MySQL and PostgreSQL to using the NoSQL database MongoDB for creating web apps. Here’s why smart web app developers like MongoDB.

What is MongoDB?

MongoDB is a free open-source document-oriented database. Classified as a NoSQL database, MongoDB does not employ the traditional table-based relational database structure in favor of JavaScript Object Notation (JSON) documents. JSON is very useful when developing a web application where fast, compact and convenient serialization of data (see below) is required to communicate complex objects between the web server for display in a web browser. As of 2014, MongoDB was the most popular NoSQL database system and is used by a several major websites and services, including Craigslist, eBay, Foursquare, and The New York Times.

Serialization is the process of translating data structures or object states into a format that can be stored on the web server and reconstructed later when needed. The data structures and states capture the information displayed on a web page. MongoDB is able to store this data easily without having to know the structure or organization of the data ahead of time.

MySQL Databases

Document databases are very different from traditional relational databases like MySQL. Relational databases store information in separate tables and every piece of data has predefined or fixed type of data format within each table.

In contrast, at the core of a document database are the documents, which can vary in the structure and type of data they contain. The data type information and the data are stored in the document itself, enabling every instance of a document to be different from any other.

Consequently document databases are more flexible in dealing with changes in web page content and data formats. The documents map more easily into the many program objects within a web or mobile app and which also vary over time with each release of the app. For example each interactive page of a web or mobile app can be stored and retrieved as such a document.

NoSQL Databases

MongoDB is the “M” in the MEAN technology stack used in many web applications written entirely in JavaScript an using the Node.js webserver. Also MongoDB is often used with a relational database to create polyglot persistence or the storage of data using the database that best fits the application.

Other popular document-oriented NoSQL databases include Cassandra, CouchDB and PostgreSQL version 9.4 and later with the JSONB data type.

By the way, Mongo was also the name of a not-so-smart tough guy character played by Alex Karras in the 1974 Mel Brooks movie satire Blazing Saddles. But alas, there is no relationship between that Mongo and the NoSQL database MongoDB. The MongoDB name was derived from the word “humongous”. And in contrast, MongoDB is used by very smart web developers around the world! Accelerance has 19 certified partners that are expert in using MongoDB.