Industry Usecase of Mongodb

Sandeshjain
9 min readSep 7, 2022

What is MongoDB?.

MongoDB is an open-source document database and leading NoSQL database. MongoDB is written in C++.

MongoDB is a cross-platform, document-oriented database that provides, high performance, high availability, and easy scalability. MongoDB works on the concept of collection and document.

◼ MongoDB History

MongoDB was developed by a company named MongoDB Inc. formerly known as 10gen based in New York. The MongoDB was founded by Dwight Merriman, Eliot Horowitz, and Kevin Ryan in 2007. This trio was the team behind DoubleClick (now owned by Google).

It was first developed as a platform as a service. It was then introduced in the market as open source database server in 2009 by MongoDB Inc. The company maintains the server and provides 24×7 email and call support. The first version of MongoDB is v1.4, which was released in March 2010.MongoDB is a document-oriented database which stores data in JSON-like documents with dynamic schema. It means you can store your records without worrying about the data structure such as the number of fields or types of fields to store values. MongoDB documents are similar to JSON objects.

Features of MongoDB:

  • Document Oriented: MongoDB stores the main subject in the minimal number of documents and not by breaking it up into multiple relational structures like RDBMS. For example, it stores all the information of a computer in a single document called Computer and not in distinct relational structures like CPU, RAM, Hard disk, etc.
  • Indexing: Without indexing, a database would have to scan every document of a collection to select those that match the query which would be inefficient. So, for efficient searching Indexing is a must and MongoDB uses it to process huge volumes of data in very less time.
  • Scalability: MongoDB scales horizontally using sharding (partitioning data across various servers). Data is partitioned into data chunks using the shard key, and these data chunks are evenly distributed across shards that resides across many physical servers. Also, new machines can be added to a running database.
  • Replication and High Availability: MongoDB increases the data availability with multiple copies of data on different servers. By providing redundancy, it protects the database from hardware failures. If one server goes down, the data can be retrieved easily from other active servers which also had the data stored on them.
  • Aggregation: Aggregation operations process data records and return the computed results. It is similar to the GROUPBY clause in SQL. A few aggregation expressions are sum, avg, min, max, etc

NoSQL vs. SQL Databases

MongoDB is a NoSQL database. This means you do not use SQL to interact with data in the database. Instead, you use NoSQL.

The first difference to discuss is vocabulary. In SQL, we use tables. In NoSQL, we use collections. In SQL, tables consist of records/rows, in NoSQL, collections are documents.

To query MongoDB, you need to use NoSQL syntax. Here is an example of a SQL query and the corresponding NoSQL query:

NoSQL Types

NoSQL databases can be categorized into four different types as given below:

Who is Using MongoDB?

In today’s IT industry, there are large number of companies who are using MongoDB as a database service for the applications or data storage systems. As per the survey made by Siftery on MongoDB, there are around 4000+ company confirmed that they are using MongoDB as Database. Some of the key names are :

  • Castlight Health
  • IBM
  • Citrix
  • Twitter
  • T-Mobile
  • Zendesk
  • Sony
  • BrightRoll
  • Foursquare
  • HTC
  • InVision
  • Intercom etc

How MongoDB Stores Data?

As you know, RDMS stores data in tables format and uses structured query language (SQL) to query database. RDBMS also has pre-defined database schema based on the requirements and a set of rules to define the relationships between fields in tables.

But MongoDB stores data in documents in-spite of tables. You can change the structure of records (which is called as documents in MongoDB) simply by adding new fields or deleting existing ones. This ability of MongoDB help you to represent hierarchical relationships, to store arrays, and other more complex structures easily. MongoDB provides high performance, high availability, easy scalability and out-of-the-box replication and auto-sharding.

MongoDB Use Cases

MongoDB is a great database for web applications, especially if the application services many users who do not interact with each other. Think financial services applications, where users only need access to their own data. Or a blogging application, where users want to log in and create/edit their own blogs. Users not interacting with each other is the key takeaway. With a relational database, one would have to store information about a user across several tables. When that user logs on, the application would have to make several queries, or complex JOIN queries, to access all the information for that user. With MongoDB’s schemaless document-database, you can store all of a user’s information together. This would allow for a single query to a single collection, and the front-end can deal with displaying/editing the data.

Another excellent use-case for MongoDB is trying to incorporate many datasets. Its schemaless design allows for flexibility in how you store your data. Thus, you can store data from several data sources (websites, databases, RSS feeds, etc) into one place, and then create services on top of your new database to analyze it all. For example, Xplenty offers this integration for MongoDB.

MongoDB is a great database for integrating geospatial data with other types of data. For example, if “location” is a piece of metadata that you’re working with, MongoDB supports GeoJSON types, so you can efficiently store latitude and longitudes. Furthermore, MongoDB supports 2DSphere Indexes, which optimize geometric calculations on sphere.

Bosch Leads Charge into the Internet of Things :

Things (e.g., devices, assets) are getting more intelligent. And every day, more and more of them are connecting to the Internet. This is forming the Internet of Things (IoT).

There’s no company more connected to this trend than the Bosch Group, a multinational engineering conglomerate with nearly 300,000 employees. Known for its appliances in the U.S., Bosch is also the world’s largest automotive components manufacturer. From smart power tools and advanced telematics to microelectromechanical systems (MEMS), it’s at the forefront of IoT.

With such a wide-reaching, diverse product base, IoT represents a huge opportunity for the Bosch Group to increase efficiency and to develop new business models. It also poses a significant challenge, to design, develop and operate innovative software and industry solutions in the IoT. Bosch Software Innovations (Bosch SI) spearheads all IoT activities inside the Bosch Group and helps their internal and external customers to be successful in the IoT.

IoT is in its infancy, but growing up fast. By some estimates, 50 billion devices, appliances and systems will be connected by 2020. Traditional systems cannot support the volume, speed and complexity of data being generated across such a vast spectrum of potential use cases. Bosch SI was looking for an innovative partner to meet the challenges of Big Data in IoT.

IoT data made valuable

IoT goes beyond simply connecting assets and devices. It requires creating services that gather data and deliver immediate insight. The Bosch IoT Suite and the integrated database from MongoDB make this possible.

Take, for example, the automotive field data app that Bosch is piloting. The app captures data from the vehicle, such as the braking system, power steering and windshield wipers. The data can then be used to improve diagnostics for preventative maintenance needs, as well as analyze how components are performing in the field. The value isn’t simply in the sensor attached to the electromagnetic components, but in how the back-end service is able to improve maintenance and product design processes.

In another example, an app based on the Bosch SI technology gives aircraft manufactures unprecedented control over how operators use highly advanced power tools used to tighten the six million screws, nuts and bolts on an airplane — a mission-critical job with zero room for error.

The app captures all data transmitted wirelessly, including battery level, operator details and time-series calibration readings. If the torque or angle is off by the slightest bit, the app sets off an alarm so the operator can make on-the-fly adjustments. It manages maintenance schedules, tracks and traces details to prevent loss, and also creates an audit trail of tightening processes for compliance with the FAA and other regulatory bodies. By connecting data to manufacturing processes in real-time, the app makes that power tool exponentially more powerful.

In both instances, the Bosch IoT Suite collects data from individual sensors and equipment — the car’s braking system, or the wireless tightening tool. MongoDB stores, manages and analyzes all of this event data in real-time. MongoDB also stores business rules that trigger alarms and notifications, such as “alert driver when brake pressure drops below a certain level” or “send alarm when tool is being used incorrectly.”

Data management reimagined for IoT

The massive volume and increasingly unstructured nature of IoT data has put new demands on Bosch SI’s entire technology stack, especially the underlying database. Rigidly defined RDBMS data models have limited use in IoT. They lack the flexibility, scale and real-time analytics needed to quickly capture, share, process and analyze IoT data.

IoT calls for a new mindset, and a new database. MongoDB helped Bosch SI reimagine what’s possible. Here’s how:

  • Manage complex data types. IoT data arrives at higher speeds, in greater volumes and variability of structure. MongoDB can easily handle the full spectrum of data: structured, semi-structured, unstructured. Efficient modeling of data using JSON makes it easy to map the information model of the device to its associated document in the database.
  • Support continuous innovation and business agility. Changes in IoT customer requirements, standards and use cases will require frequent data model changes. MongoDB’s dynamic schema supports agile, iterative development methodologies and makes it simple to evolve an app. Adding new devices, sensors and assets is straightforward, even when you’re dealing with multiple versions in the field concurrently. Instead of wasting time dealing with the mismatch between programming language and the database, MongoDB lets developers focus on creating rich, functional apps.
  • Create a unified view. Creating a single view of an asset or customer with a relational database is complicated. Source schema changes require additional changes to the single view schema. MongoDB makes it easy to aggregate multiple views of related data from different source systems into one unified view.
  • Power operational insight with real-time analysis. Apps handling fast-moving IoT data can’t wait on ETL processes to replicate data to a data warehouse. They need to react and respond in real time. MongoDB’s rich indexing and querying capabilities — including secondary, geospatial and text search indexes, the Aggregation Framework and native MapReduce — allow users to ask complex questions of the data, leading to real-time operational insight and business discovery.
  • Be enterprise-ready. MongoDB complements agility with enterprise-grade availability, security and scalability. Zero downtime with replica sets. Proven database security with authentication, authorization, auditing and encryption. Cost-effective scale-out across commodity hardware with auto-sharding. As IoT data volumes continue to explode, Bosch will be able to efficiently scale without imposing additional complexity on development teams or additional cost on the business.

A bet that paid off

Bosch SI is making a strategic bet on MongoDB to drive innovative apps in every industry where it does business. It can improve the retail shopping experience with in-store maps and personalized notifications. Create safer working conditions in manufacturing environments. Trace agriculture through the food chain to support farm-to-table initiatives.

The use cases are limitless. And MongoDB makes every single one possible.

The IoT market is exploding and Bosch is moving quickly. Bosch SI is continuing development on new apps and working closely with MongoDB to scale up existing apps — like growing a three million car pilot to a 300 million car application.

With MongoDB, scale-out will be fast, reliable and cost-effective.

As a technology provider, partner and fellow innovator, MongoDB is in lock-step with Bosch SI. Bosch SI is accelerating implementation of new IoT apps and business models, ensuring the business units and customers it serves don’t miss a beat as new generations of sensors and equipment come online.

--

--