MongoDB and its Industrial Use Cases
MongoDB is a cross-platform , open-source document oriented , leading NoSQL database. written in C++ & stores data in JSON-like documents , provides, high performance, high availability, and easy scalability.
MongoDB works on concept of collection and document.
Database
Database is a physical container for collections. Each database gets its own set of files on the file system. A single MongoDB server typically has multiple databases.
Collection
Collection is a group of MongoDB documents. It is the equivalent of an RDBMS table. A collection exists within a single database. Collections do not enforce a schema. Documents within a collection can have different fields. Typically, all documents in a collection are of similar or related purpose.
Document
A document is a set of key-value pairs or say support JSON language . Documents have dynamic schema. Dynamic schema means that documents in the same collection do not need to have the same set of fields or structure, and common fields in a collection's documents may hold different types of data.
Relationship of RDBMS terminology with MongoDB
MongoDB CRUD Operations
- Create Operation - MongoDB use DATABASE_NAME is used to create database. The command will create a new database if it doesn't exist, otherwise it will return the existing database.
- Read/Query Operation - To query data from MongoDB collection, you need to use MongoDB's find() method.
- Update Operation - MongoDB's update() and save() methods are used to update document into a collection. The update() method updates the values in the existing document while the save() method replaces the existing document with the document passed in save() method.
- Delete Operation - To delete Document/Data from MongoDB collection, you need to use MongoDB's drop() method.
Indexing in MongoDB
- Indexes support the efficient resolution of queries. Without indexes, MongoDB must scan every document of a collection to select those documents that match the query statement. This scan is highly inefficient and require MongoDB to process a large volume of data.
- Indexes are special data structures, that store a small portion of the data set in an easy-to-traverse form. The index stores the value of a specific field or set of fields, ordered by the value of the field as specified in the index.
Aggregation Operations of MongoDB
- Aggregations operations process data records and return computed results. Aggregation operations group values from multiple documents together, and can perform a variety of operations on the grouped data to return a single result.
- In SQL count(*) and with group by is an equivalent of MongoDB aggregation.
- For the aggregation in MongoDB, you should use aggregate() method.
Sharding in MongoDB
- Sharding is the process of storing data records across multiple machines and it is MongoDB's approach to meeting the demands of data growth. As the size of the data increases, a single machine may not be sufficient to store the data nor provide an acceptable read and write throughput.
- Sharding solves the problem with horizontal scaling. With sharding, you add more machines to support data growth and the demands of read and write operations.
MongoDB Atlas
- The core of MongoDB Cloud is MongoDB Atlas, a fully managed cloud database for modern applications. Atlas is the best way to run MongoDB, the leading modern database. MongoDB's document model is the fastest way to innovate, bringing flexibility and ease of use to the database.
- Atlas is available on 70+ regions across AWS, GCP, and Azure. Best-in-class automation and proven practices guarantee availability, scalability, and compliance with the most demanding data security and privacy standards.
Advantages & Limitations of MongoDB
The following are the few advantages of MongoDB NoSQL database
- MongoDB is a schema-less NoSQL database. We do not need to design the schema of the database when we are using MongoDB. This saves a lot of time. Thus, the code we write defines the schema.
- No complex joins are needed in MongoDB. There is no relationship among data in MongoDB.
- MongoDB is easy to scale.
- It is very easy to set-up and install MongoDB.
- The document query language supported by MongoDB is very simple as compared to SQL queries.
- Because the MongoDB uses JSON format to store data, it is very easy to store arrays and objects.
- MongoDB is free to use. There is no cost for it.
There are a few disadvantages of the MongoDB NoSQL database as well.
- MongoDB uses high memory for data storage.
- There is a limit for document size, i.e. 16mb.
- There is no transaction support in MongoDB.
Where to Use MongoDB?
- Big Data
- Content Management and Delivery
- Mobile and Social Infrastructure
- User Data Management
- Data Hub
illimity & MongoDB
There’s a new paradigm bank in Italy called illimity. it can provide the latest mobile services at an incredible speed. And it's the reason why illimity can combine reliable customer experience with new modern features.
illimity started to build its entire organization and technical architecture from scratch. It did so on the global cloud database service, MongoDB Atlas on Microsoft Azure.
At illimity, MongoDB Atlas is being used to build a 360-degree single view to improve customer experience, fight fraud and comply with the GDPR. The key innovations include:
- Internet & Mobile Banking
- Security & Compliance
- Non-performing Loans
- Credit Acquisition
Experian Health & MongoDB
Experian Health, the healthcare industry leader for automating, integrating and transforming the front and back end revenue cycle management process, is leveraging data to improve and modernize healthcare services, ultimately improving patient care. To enable this innovation, the company relies on MongoDB, the database for giant ideas, as its non-relational database of choice.
Experian Health built a Universal Identity Manager platform with MongoDB to fill a critical gap in how medical groups identify patients throughout their care journey. This patient identifier platform brings together data from disparate databases, systems, and data formats to create a single view of a patient and improve the safety, speed, quality, and cost of care for patients and caregivers alike.
Experian Health Bringing Patient Identification into Modern Era with MongoDB
AO.com & MongoDB
AO.com is one of the UK’s leading online electrical retailers.
To ensure they could move quickly and keep the team focused on business goals, the team chose to use the MongoDB Atlas Database Service in the cloud.
MongoDB supports rich customer objects that they can further enrich at any stage without expensive schema migrations. And strongly typed temporal data formats are valuable for their app. In terms of overall functionality, for their use case, MongoDB was the clear choice to help them achieve their goals. For example -
- Call center experience – they were able to reduce the number of times a customer needs to call as their agents can access all of the data they need immediately.
- Fraud – It was helping them to improve fraud detection lead time and be proactive in monitoring potential fraud trends.
- GDPR compliance – obviously there are many teams involved in making sure to have a platform in place that can easily answer the questions from the legal department has been crucial.
FACEIT & MongoDB
FACEIT an quickly become the leading platform for online competitions in Player versus Player (PvP) multiplayer games including League of Legends, Counter-Strike and DOTA 2. they have attracted over 4.3 million users since launch, and now every month host 2,000+ tournaments and manage 6 million game sessions.
MongoDB is their main database underpinning platform. they use it orchestrate services between players, teams, and competitions. All user profiles and tournament data is managed by MongoDB.
On average, each tournament match involves 10 players generating streams of time-series statistics, all of which are written to MongoDB. We use the data we collect in MongoDB to drive sophisticated analytics that track player behavior, engagement, and competitive performances in tools such as Mixpanel and Keen IO.
Data has always been an essential part of video games. From player profiles to telemetry, matchmaking to leaderboards, data is crucial to making games work – and making them better.
Thank You for Reading !!
DevOps Engineer || Python || Docker || Ansible || Kubernetes || AWS || Jenkins || Buildkite || GoCD || GIT || GITHUB ||
3 年Great Mahak Jain
Devops Engineer @ SquareOps Technologies | KCNA certified | Redhat 2x Certified | Kubernetes | Docker | Aws | Linux | ArgoCD | Terraform |
3 年Good job