The Rise of MongoDB

Photo by Franki Chamaki / Unsplash

Disclaimer: I do not build database engines. I build web applications.

MongoDB began development in 2007, but it wasn’t until 2009 that it shifted into an open source development model.

It wasn’t always incredibly popular, but now it’s become known as the next generation document storage system.

What is MongoDB? Really?

MongoDB is a NoSQL database. NoSQL databases became popular for a few reasons:

1.) Developers are creating applications with masses of new, and rapidly changing data types.

Traditional SQL databases don’t allow you to modify previously created documents with ease. This is because relational databases weren’t designed to cope with modern development techniques.

2.) The waterfall development cycle isn’t widely used anymore, and has been replaced with Agile development methodology.

The waterfall development cycle separates development into different phases. This has been almost completely replaced by agile methods that have weekly sprint plans where developers ship out code every week.

The ultimate goal of an Agile development process is to create a minimum viable product with only the essential features in tact.

MongoDB is easy to use

MongoDB is popular among new developers due to it’s flexibility and ease of usage. Even though it’s easy to use it still provides all the capabilities needed to meet the complex requirements of modern applications.

A lot of developers like Mongo because it stores all of it’s documents in JSON.

JSON became the go to language for data exchanging because it’s faster, and less verbose than XML. It also makes building RESTful API’s relatively seamless.

Additionally, with the rapidly growing popularity of Javascript Development, JSON fit’s seamlessly into many web developer’s code bases.

To take it one step further, external libraries such as Mongoose clean things up a lot. It’s easier than ever to make the shift from a frontend developer to a full stack developer.

ODM’s like Mongoose also add built in security that keep your applications free from injections. A side benefit of Mongoose is form sanitation.

Modern Technology Stacks

There’s no shortage of job opportunities for experienced MongoDB developers.

The most rapidly growing tech stacks all seem to use MongoDB.

MongoDB is used in the MEAN stack as well as the MERN stack. These modern technology stacks are shaping the future of web applications.

Price

The price of MongoDB storage scales as you grow. This makes it convenient for use in personal projects.

You only pay for what you use.

There are a lot of great options to choose from as well:

mLab:

I personally use mLab in all of my personal projects because it’s easy to set up with my host of choice, Heroku. mLab is free to use while starting out, but as you scale you have to option to pay as you go. But you’ll need to pay for an SSL certificate.

This makes it popular among developers who are looking to launch quickly. One of the drawbacks of mLab is that it doesn’t support editing documents in mass yet.

Atlas:

Mongo Atlas is provided by MongoDB. It offer security right out the box. It’s also really ideal if you deploy using AWS.

Atlas is also always up to date.

Managed MongoDB Hosting | Database-as-a-Service
Host MongoDB in the cloud with MongoDB Atlas, the official database-as-a-service, on AWS, Azure and GCP. Try free!

MongoDB’s Competitors

Mongo DB is definitely not short of competition.

Even though it’s popularity is growing, it still isn’t the most widely used cloud storage database.

According to db-Engines.com, MongoDB is the fifth most popular database.

DB-Engines - Knowledge Base of Relational and NoSQL Database Management Systems
DB-Engines is an initiative to collect and present information on relational and NoSQL database management systems (DBMS)

Above it are PostgreSQL in fourth place, Microsoft SQL Server in third, MySQL in second place, and sitting in the top spot, Oracle.

What makes MongoDB stand out from the rest of these is that it’s Database model is different than the others.

PostgreSQL, Microsoft SQL Server, MySQL, and Oracle all share something. Each of them has the same database model. They are known as Relational Database Management Systems. MongoDB on the other hand, uses something called a Document Store database model.

Document Stores, also called, document-oriented database systems, are characterized by their schema-free organization of data.

That means:

  • Records do not need to have a uniform structure, i.e. different records may have different columns.
  • The types of the values ​​of individual columns can be different for each record.
  • Columns can have more than one value (arrays).
  • Records can have a nested structure.

Relational Database Management Systems support a relational table model. This is why their records can not be changed.

They are defined by the table name and a fixed number of attributes with fixed data types. This means that all records must be uniform.

Companies that use MongoDB

So what companies actually use MongoDB?

MongoDB is used by Adobe, Buzzfeed, Comcast, Cisco, CodeAcademy, Craigslist, Ebay, EA, E-Harmony, Forbes, Google, Foursquare, IBM, Infosys, the United Kingdom Government, among many, many others.

A search on Indeed for jobs with MongoDB as a keyword returned over 500 results in San Francisco alone.

What problems does Mongo have?

Developers tend to be very opinionated people. If you look up MongoDB problems on Google, you’re sure to find lots of people shouting to the sky that you should never use MongoDB. Let’s examine the claims some of these developers make.

Since MongoDB is denormalized, it doesn’t adhere to a relational schema. Everything is stored in nested JSON objects called documents. While this allows for greater flexibility with your data models, it forces more schema based design decisions on the app logic rather than the db.

Even though there are some problems with MongoDB, the community has seemed to solve some of these issue with open source libraries.

Libraries like Mongoose create solutions for making asynchronous writes synchronous.

Mongoose ODM v5.10.2
Mongoose ORM

Although these solutions do provide general hot fixes for the pitfalls of MongoDB they still may not provide the security and reliability of transactions that other Database storage solutions might. Be sure to account for these potential issues before using MongoDB with your app.

Conclusion

MongoDB is still my database storage of choice, especially because it lets us change our models on the go, and uses JSON documents to record data.

Many startups today are choosing MongoDB as well, and this trend hasn’t changed for at least the past five years.

Even though MongoDB isn’t a perfect solution, it’s worth checking out, due to it’s ease of use alone.

The most popular database for modern apps
We’re the creators of MongoDB, the most popular database for modern apps, and MongoDB Atlas, the global cloud database on AWS, Azure, and GCP. Easily organize, use, and enrich data — in real time, anywhere.