Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

A Case study on MongoDB

Objective

In this case study, we see how MongoDB Cloud Migration Helps World's Biggest Media Brand
Continue To Set Standard For Digital Innovation.

There are many things that would be extremely difficult, if not impossible, to do without
databases… The Internet, GPS, electronic banking, and a variety of other technologies.

They eliminate the need for a human to go through millions of file cabinets in order to
locate a certain record. They provide a standard and efficient method for programmers to store,
retrieve, and modify data.

DataBase

Databases are all around you, even if you don’t recognize it. Whether or whether you know
anything about them, or care to, their impact on our everyday lives is significant. Databases
power many of the services we use on a daily basis, from weather programs to online movies.

A database is a collection of data, usually stored in electronic form. A database is typically


designed so that it is easy to store and access information.
Types of databases

1. SQL:-

SQL is Structured Query Language, which is a computer language for storing, manipulating
and retrieving data stored in a relational database. SQL is the standard language for Relational
Database System. All the Relational Database Management Systems (RDMS) like MySQL,
MS Access, Oracle, Sybase, Informix, Postgres and SQL Server use SQL as their standard
database language. Also, they are using different dialects, such as −. MS SQL Server using T-
SQL, Oracle using PL/SQL,

2. NoSQL

NoSQL Database is used to refer a non-SQL or non relational database. It provides a


mechanism for storage and retrieval of data other than tabular relations model used in relational
databases. NoSQL database doesn't use tables for storing data .

• Structure and type of data being kept: SQL/Relational databases require a structure
with defined attributes to hold the data, unlike NoSQL databases which usually allow
free-flow operations.
• Querying:- Regardless of their licences, relational databases all implement the SQL
standard to a certain degree and thus, they can be queried using the Structured Query
Language (SQL). NoSQL databases, on the other hand, each implement a unique way
to work with the data they manage.
• Scaling:- Both solutions are easy to scale vertically (i.e. by increasing system
resources). However, being more modern (and simpler) applications, NoSQL solutions
usually offer much easier means to scale horizontally (i.e. by creating a cluster of
multiple machines).
• Reliability:- When it comes to data reliability and safe guarantee of performed
transactions, SQL databases are still the better bet.
• Support:- Relational database management systems have decades long history. They
are extremely popular and it is very easy to find both free and paid support. If an issue
arises, it is therefore much easier to solve than recently-popular NoSQL databases –
especially if said solution is complex in nature (e.g. MongoDB).

What is Mongodb ?

MongoDB is a source-available cross-platform document-oriented database program.


Classified as a NoSQL database program, MongoDB uses JSON-like documents with
optional schemas. MongoDB is developed by MongoDB Inc. and licensed under the Server
Side Public License.

MongoDB’s document model is simple for developers to learn and use, while still providing
all the capabilities needed to meet the most complex requirements at any scale. We provide
drivers for 10+ languages, and the community has built dozens more.

Companies and development teams of all sizes use MongoDB because: The document data
model is a powerful way to store and retrieve data that allows developers to move
fast. MongoDB's horizontal, scale-out architecture can support huge volumes of both data and
traffic.

MongoDB is an object-oriented, simple, dynamic, and scalable NoSQL database. It is based


on the NoSQL document store model. The data objects are stored as separate documents inside
a collection instead of storing the data into the columns and rows of a traditional relational
database.
Use cases of MongoDB

1. Single View Explained

A Single View application aggregates data from multiple sources into a central repository to
create a single view of anything. Example applications include: Government ,Financial
Services, etc.

2. Internet Of Things (IoT)

Today the IoT is enabling companies to blend the physical and digital worlds. Realizing the
business value of connecting all of these “things” enables creation of new revenue models,
improves productivity, and generates new insights that drive operational efficiencies. The IoT
already connects billions of devices worldwide, and that number is growing daily. Many market
observers predict that only by adopting IoT can organizations fully unlock the revenue
opportunities promised by digital transformation. MongoDB can help you rapidly capture the
most value from the IoT.

3. Mobile Application

MongoDB Realm drastically changes the speed at which we’re able to unlock and build new
features. It has a measurable impact on our developer experience and time-to-market.
MongoDB’s JSON document model lets you store back-end application data wherever you
need it, including in Apple iOS and Android devices as well as cloud-based storage solutions.
This flexibility lets you aggregate data across multiple environments with secondary and
geospatial indexing, giving developers the ability to scale their mobile applications seamlessly.
4. Real-time analytics

As companies scale their operations, gaining access to key metrics and business insights from
large pools of data is critical. MongoDB handles the conversion of JSON and JSON-like
documents, such as BSON, into Java objects effortlessly, making the reading and writing of
data in MongoDB fast and incredibly efficient when analyzing real-time information across
multiple development environments. This has proved beneficial for several business sectors,
including government, financial services and retail.

5. Content management systems

Content management systems (CMS) are powerful tools that play an important role in ensuring
positive user experiences when accessing e-commerce sites, online publications, document
management platforms and other applications and services. By using MongoDB, you can easily
add new features and attributes to your online applications and websites using a single database
and with high availability.

6. Enterprise Data Warehouse

The Apache Hadoop framework is a collection of open source modules, including Hadoop
Distributed File System and Hadoop MapReduce, that work with MongoDB to store, process
and analyze large amounts of data. Organizations can use MongoDB and Hadoop to perform
risk modeling, predictive analytics and real-time data processing.

Problems solves by MongoDB

• Integrating large amounts of diverse data: - If you are bringing together tens or
hundreds of data sources, the flexibility and power of the document model can create a
unified single view in ways that other databases cannot. MongoDB has succeeded in
bringing such projects to life when approaches using other databases failed.
• Describing complex data structures that evolve:- Document databases allow
embedding of documents to describe nested structures and easily tolerate variations in
data in generations of documents. Specialized data formats like geospatial are
efficiently supported. This results in a repository that is resilient and doesn’t break or
need to be redesigned every time something changes.
• Delivering data in high-performance applications:- MongoDB’s scale-out
architecture can support huge numbers of transactions on humongous databases. Unlike
other databases that either cannot support such scale or can only do so with massive
amounts of engineering and additional components, MongoDB has a clear path to
scalability because of the way it was designed. MongoDB is scalable out of the box.
• Supporting hybrid and multi-cloud applications:- MongoDB can be deployed and
run on a desktop, a huge cluster of computers in a data center, or in a public cloud,
either as installed software or through MongoDB Atlas, a database as a service product.
If you have applications that need to run wherever they make sense, MongoDB supports
any configuration now and in the future.
• Supporting agile development and collaboration: Document databases put
developers in charge of the data. Data becomes like code that is friendly to developers.
This is far different from making developers use a strange system that requires a
specialist. Document databases also allow evolution of the structure of the data as needs
are better understood.
MongoDB Features

Let us now define and understand each feature :

1. Ad Hoc Queries Support

Basically, when we are in the Database Design phase, we have no idea of what queries might
be executed. So, when we say, MongoDB supports Ad Hoc Queries, it means that the
MongoDB supports queries that were not known while establishing a structure for the database.
This is an amazing feature that makes MongoDB stand out. Ad hoc queries function in a way
to better the performance and are real-time.

2. Indexing

One of the most important features for a Database is Indexing, which results in improvements.
We can index any field in MongoDB. Creating indexes helps in faster search results. Indexing
is possible with any field or key, in a document.

3. Replication

Simply speaking, replication is a process of, distributing the data on multiple servers and
keeping everything synchronized. Primary Node and Secondary Nodes are introduced here.

Working: Whenever a primary node, with the data, is down or experiences failure, the
secondary node will be the working primary node, making it possible for the data to be
available. This feature is important regarding Data Storage and Backup, as it allows us to
recover and restore, in case of failure in hardware or services. Thanks to this replication, that
data is made available with multiple copies on different locations. Time is saved, and no
operation is halted due to this amazing feature.
4. Schema-less Database

One of the most primarily discussed features of MongoDB is, it being Schemaless. Meaning
that there can be multiple documents in a collection, with different keys, and these keys might
not be found in other documents. This is the major reason behind MongoDB’s flexibility, with
data. We can have multiple documents or records in a single, same collection, but with different
key values pairs.

5. Document Oriented

Being Document Oriented is a great feature that helps MongoDB stand out among others. We
have tables and rows columns structure for SQL, we have fields in key values pair, with
MongoDB.

6. Aggregation Pipeline

Aggregation Framework is one of the most efficient features offered by MongoDB. Simply
speaking it is a process of creating a pipeline of multiple operations and getting a final result,
filtered. Aggregation pipelines can be created as per needs. The end result must be thought
carefully while building the pipeline.

7. GridFS

When a file exceeds the BSON document limit of 16 MB, it is divided into multiple small
chunks and stored separately in various documents. These chunks have a size of 255KB,
excluding the last chunk. GridFS, which stands for Grid File System, use two separate
collections. One collection is used to store the larger file’s chunks, while the second collection
is used to store the metadata. When we execute a query for this file, the GridFS will collect and
return all the chunks together. GridFS also implements the Indexing, which allows the query
execution for returning the file easier.

8. Sharding

When we are encountered with large datasets, we can implement the Sharding of Data.
Meaning, the large datasets are split and shared across multiple machines. The massive data
can cause unexpected problems, but the implementation of sharding can be useful. Sharding is
the process of database partitioning and spreading across multiple machines, while the
replication is the process of making multiple copies of the database. The data is distributed
over multiple collections, and these collections are known as “Shards”.

9. High Performance

MongoDB is open-source, is one the highest performing database. With the implementation of
replication and indexing, query execution and data fetching are faster. With developing
multiple applications, the need to check the performance is mandatory. Database Profiling,
which collects the complete data for every operation that is executed against the MongoDB
instance. The output provided by the DB Profiler can help us understand the queries and
operations that are being inefficient.
Forbes :- Case study

"We're very glad we moved to the cloud when we did. Shifting quickly to Google Cloud and
MongoDB Atlas put us in a position to innovate and thrive even in the most difficult
circumstances."

In 1996 Forbes launched its first website. It was one of the first business publications in the
world to do such an innovative thing. The original digital transformation.

In the 25 years since Forbes has only accelerated its efforts and is widely considered to set
the standard for digital innovation in the publishing industry. The 100-year-old publisher,
famous for its business journalism and rich-lists, has become the largest business media
brand in the world. It reaches more than 140 million people worldwide every month, across a
number of online and offline channels.

Result after using MongoDB

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, 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.

Despite the turmoil and unprecedented digital traffic it created, the development team
continued to build, launch and test industry-leading features such as AI-assisted
technology that recommend stories for its journalists and new data analysis tools to better
understand reader behavior.

This ease of adaptation was powered by another change which had come just in time. At the
end of 2019, Forbes finished the first stage of a comprehensive migration to the cloud. It
included moving much of its transactional workload to MongoDB Atlas, the global cloud
database service, and the Google Cloud.

Conclusion

Document oriented and schema-less structure makes the MongoDB one of the preferable
choice. Many other features like Aggregation pipeline, Sharding, Replication, etc. help the
database query results faster with better performance. Load Balancing is done with these
features results in better performance. All these features make the MongoDB one of the better
choice for Big Data Application and Real-Time Applications.

I hope this will help you to understand the power of Mongodb.

You might also like