MongoDB
Introduction to MongoDB
When dealing with data, there are two types of data as we know — (i) structured data and (ii) unstructured data. Structured data is usually stored in a tabular form whereas unstructured data is not. To manage huge sets of unstructured data like logs or IoT data, a NoSQL database is used.
Now, what is MongoDB?
- MongoDB is an open-source NoSQL database written in C++ language. It uses JSON-like documents with optional schemas.
- It provides easy scalability and is a cross-platform, document-oriented database.
- MongoDB works on the concept of Collection and Document.
- It combines the ability to scale out with features such as secondary indexes, range queries, sorting, aggregations, and geospatial indexes.
- MongoDB is developed by MongoDB Inc. and licensed under the Server Side Public License (SSPL).
Advantages of MongoDB over RDBMS
- Schemaless − MongoDB is a document database in which one collection holds different documents. The number of fields, content and size of the document can differ from one document to another.
- The structure of a single object is clear.
- No complex joins.
- Deep query-ability. MongoDB supports dynamic queries on documents using a document-based query language that’s nearly as powerful as SQL.
- Tuning.
- Ease of scale-out − MongoDB is easy to scale.
- Conversion/mapping of application objects to database objects not needed.
- Uses internal memory for storing the (windowed) working set, enabling faster access of data.
Why Use MongoDB?
- Document Oriented Storage − Data is stored in the form of JSON style documents.
- Index on any attribute
- Replication and high availability
- Auto-Sharding
- Rich queries
- Fast in-place updates
- Professional support by MongoDB
Where to Use MongoDB?
- Big Data
- Content Management and Delivery
- Mobile and Social Infrastructure
- User Data Management
- Data Hub
Use Cases
Single View
Real-time views of your business that integrate all of your siloed data.
A Single View application aggregates data from multiple sources into a central repository to create a single view of anything.

How MongoDB Makes Single View Easy
- Documents- Using MongoDB’s document model, you can incorporate any type of data, no matter what it looks like or where it comes from. JSON documents support all the basic data types you’d expect (e.g., numbers, strings, binary data, arrays) without requiring you to define or enforce a schema.
- Dynamic Schemas- Schemas in MongoDB are self-describing. Iterate on the schema without having to rethink it entirely. Pull in new data when you need to. MongoDB documents can also vary in structure, which means documents from one system don’t need to have all the same fields as documents from another.
- MongoDB’s expressive query language, indexing, and aggregation capabilities make it possible to find and filter the data, no matter how the business needs to access it.
The Internet Of Things (IoT)
- Ease: Documents match objects in code, making it faster and easier for developers to build new IoT apps. JSON is the language of APIs, which means you can use the same data model and syntax from the device to the backend. This increases developer productivity and enhances both efficient API design and data model consistency
- Flexibility: Add new time series data elements, sensors, and devices without the need to wrangle with database schema changes
- Versatility: Query IoT data any way you want to support rich application functionality, real-time analytics, and user experience
- Integration: Work seamlessly with all of the leading systems for streaming data, machine learning, BI, and more
- Security: Robust access controls, auditing, and encryption controls protect valuable IoT data both in flight and at rest.

Real-Time Analytics
Organizations are using MongoDB for analytics because it lets them store any kind of data, analyze it in real-time, and change the schema as they go.
- New Data- MongoDB’s document model enables you to store and process data of any structure: events, time-series data, geospatial coordinates, text and binary data, and anything else. You can adapt the structure of a document’s schema just by adding new fields, making it simple to bring in new data as it becomes available.
- Horizontal Scalability- MongoDB’s automatic sharding distributes data across fleets of commodity servers, with complete application transparency. With multiple options for scaling — including range-based, hash-based and location-aware sharding — MongoDB can support thousands of nodes, petabytes of data, and hundreds of thousands of ops per second without requiring you to build custom partitioning and caching layers.
- Powerful Analytics- In Place, In Real-Time. With rich index and query support — including secondary, geospatial and text search indexes — as well as the aggregation framework and native MapReduce, MongoDB can run complex ad-hoc analytics and report in place.
To Know more use-cases of MongoDB: https://www.mongodb.com/use-cases