MongoDB — A case study

ivsntejesh
5 min readMay 9, 2021

This article helps in understanding the term MongoDB, Need for it and some use cases of how the industry is using MongoDB

MongoDB is a NoSQL, Document-based model, and Schemaless Database. It is one of the most widely used database models. It is flexible, scalable, easy to maintain, and manage.

Before going deep dive into MongoDB. first, let us understand what is data model, the difference between the NoSQL and SQL, different types of NoSQL databases.

Now that we know MongoDB is a NoSQL database let us go into what is NoSQL and its need for it?

NoSQL stands for Not Only SQL. This means it is not based on SQL,

It has a dynamic schema for unstructured data. Data is stored in many ways which means it can be document-oriented, column-oriented, graph-based, or organized as a KeyValue store. This flexibility means that documents can be created without having a defined structure first.

What is Data Model?

A data model is an abstract model that organizes elements of data and standardizes how they relate to one another and to the properties of real-world entities. It refers to the logical inter-relationships and data flow between different data elements involved in the information world.

There are many kinds of data models of which these are some of the models,

  • Hierarchical database model
  • Relational model
  • Network model
  • Object-oriented database model
  • Entity-relationship model
  • Document model

Every data can be categorized into 2 types SQL based and NoSQL-based.

SQL stands for Structured Query Language. It is designed for managing data in a relational database management system (RDBMS). It has a fixed schema, relational-based, Horizontally scalable, table-based model.

The main difference between SQL and NoSQL is as follows,

source: Geeks for Geeks

MongoDB: —

MongoDB uses the Documental model as its core. It uses JSON to store the data. In the SQL world, we have DB → Table → Fields and records, whereas in MongoDB we have DB → Collections → Documents.

Each data is stored in documents, due to which it has the capacity to add as many columns to the data.

Its main features include

  1. Ad-hoc queries
  2. Indexing
  3. Mapreduce
  4. Aggregation
  5. Replication
  6. Load balancing

These make using MongoDB a great choice for MySQL. Coming to how the industry is using MongoDB there are a number of ones who use namely Google, KPMG, Intuit, Adobe, Forbes, Toyota, AstraZanika, Vivint, Royal Bank of Scotland, SAP, EA, Cisco, Appolo Group, Pearson, and many more.

Case study — 1 AstraZeneca

AstraZeneca embarked on an ambitious program to use next-generation genome sequencing to develop drugs to fight all kinds of diseases, including cancer. The technology creates a synthetic version of messenger RNA, which helps create protein in cells. If successful, the proteins could fight cancer, among other diseases.

Unfortunately, such genomic sequencing requires a great deal of computing power. As Jason Tetrault, architect of R&D information at AstraZeneca explained recently, analyzing 88 whole human genomes took 15,000 hours and 171 terabytes (TB) of data. Analyzing a single human genome can take four days.

AstraZeneca’s experiment involved taking 10% of all its compounds and pulling in information from its disparate database systems. Using MongoDB, the company was able to execute Tanimoto comparisons on about 500,000,000 compounds.

AstraZeneca can pursue links and patterns that it never noticed before. “Maybe this worked for 10% in liver cancer but wow this lung cancer actually has the same biomarker says, Tetrault.

Case study — 2 Forbes

In just six months, Forbes migrated its platform to Google Cloud and MongoDB Atlas. Results include:

  • 58% faster build time for new products and fixes
  • Accelerated release cycle by 4x
  • Reduced total cost of ownership by 25%
  • 28% increase in subscriptions from new newsletters

During the pandemic the cloud infrastructure has also helped the website scale to an extraordinary number of users and helped the team stay nimble, introducing and testing a number of new features.

From June to December last year 2020, traffic continued to grow — setting new records month after month. Then came COVID-19. Like many high-profile publications, Forbes’ coverage of the pandemic has driven a further increase in traffic, reaching record traffic in May with more than 120 million unique visitors.

The combination of MongoDB Atlas within Google Cloud’s native microservice architecture would also prove a wise choice. Firstly, Google Cloud’s Kubernetes Engine made it more manageable to orchestrate Forbes’ horde of more than 50 microservices. (Focused, self-contained codebases that allow each service to be easily understood, modified quickly without dependencies on other services, and to be built with the best technology for the task.) Secondly, Atlas was also able to work seamlessly with Google Cloud’s suite of services to build even more powerful tools for its writers.

In April, Forbes introduced a trending story recommendation engine for journalists. The engine scrapes the internet for trending stories and uses Google Cloud’s machine learning to make suggestions to appropriate contributors, either through a Slack bot or through the custom CMS (the CMS itself had been rewritten again in 2019 to become more of an AI and analytics-driven platform). Like everything at Forbes, the engine is still undergoing heavy testing but it has proved instantly helpful to Forbes’ editorial team and contributor network.

Forbes’ cloud migration led to a 58% improvement in build speed and the release cycle has improved 2x to 10x (depending on the service). Other efficiencies that came with the migration resulted in a 25% reduction in the total cost of ownership.

--

--