MongoDB and its Use-Case
Pratik Kohad ????
SIH Grand Finalist 2020 || MLops || ARTH Ambassador and Learner at LinuxWorld Informatics Pvt. Ltd
Task Description??
???Create one use-case blog or case study on how industries are using MongoDB.
Hello, Connections !!!
This is an important article on MongoDB, its components, advantages, features, and why we use MongoDB, and its industrial use-cases. In this article,?you will get to know about MongoDB in detail.
Let's Dive in !!!
Web-based applications and their data management needs have changed dynamically in the past few years. A variety of features and strict data consistency is provided by the relational databases. Due to the massive cost of storing and manipulating data in classical relational database systems, NoSQL databases have been developed. NoSQL databases provide more scalability and heterogeneity when compared to RDBMS. MongoDB, a NoSQL database provides high scalability, performance, and availability. MongoDB is a document-based NoSQL database designed for Internet and web-based applications. The data model of MongoDB is easy to build on due to its inherent support for unstructured data. MongoDB does not require costly and time-consuming migrations when application requirements change. MongoDB's documents are encoded in a JSON-like format called BSON. This paper describes the advantages of MongoDB when compared to other NoSQL databases and its applications in sentiment analysis.
MongoDB is the leading modern, general-purpose database platform, designed to unleash the power of software and data for developers and the applications they build. Headquartered in New York, MongoDB has more than 29,000 customers in over 100 countries. The MongoDB database platform has been downloaded over 200 million times and there have been more than 1.5 million registrations for MongoDB University courses.
What is NoSQL?
When people use the term “NoSQL database”, they typically use it to refer to any non-relational database. Some say the term “NoSQL” stands for “non SQL” while others say it stands for “not only SQL.” Either way, most agree that NoSQL databases are databases that store data in a format other than relational tables.
A common misconception is that NoSQL databases or non-relational databases don’t store relationship data well. NoSQL databases can store relationship data — they just store it differently than relational databases do. In fact,?when compared with SQL databases, many find modeling relationship data in NoSQL databases to be?easier?than in SQL databases, because related data doesn’t have to be split between tables.
NoSQL data models allow related data to be nested within a single data structure.
NoSQL databases emerged in the late 2000s as the cost of storage dramatically decreased. Gone were the days of needing to create a complex, difficult-to-manage data model simply for the purposes of reducing data duplication. Developers (rather than storage) were becoming the primary cost of software development, so NoSQL databases were optimized for developer productivity.
NoSQL vs. SQL Databases
What is MongoDB?
MongoDB is a database management system designed for the Internet and web-based applications. It is a document-based NoSQL database. The data model and persistence strategies are built for high read and write throughput and the ability to scale easily with automatic failover. MongoDB’s document data model makes it easy to build on since it has inherent support for unstructured data and does not require costly and time-consuming migrations when application requirements change.
MongoDB’s documents are encoded in a JSON-like format, called BSON. BSON is a natural fit for modern object-oriented programming methodologies and is lightweight, fast, and traversable. MongoDB uses BSON as a network transfer format for documents. BSON at first seems BLOB-like, but there exists an important difference: the MongoDB database understands BSON internals. This means that MongoDB can reach inside BSON objects, even nested ones, using dot notation. This allows MongoDB to build indexes and match objects against query expressions on both top-level and nested BSON keys.
MongoDB also supports rich queries and full indexes. This distinguishes it from other document databases in which a separate server layer is used to handle complex queries. Its other features include automatic sharding, replication, and easy storage. The increasing popularity of
MongoDB and the large amounts of user-related sensitive information stored in these databases raise the concern for the confidentiality and privacy of the data and the security provided by these systems. When MongoDB was initially designed, security was not a primary concern of its designers.
Components of MongoDB:
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.
1. Database
The 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.
2. Collection
A 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 purposes.
3. Document
A document is a set of key-value pairs. Documents have a 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.
Why Use MongoDB?
MongoDB is a document, NoSQL database that offers ease of implementation while combining performance, high availability, and automatic scaling. MongoDB, compared to MySQL, enables users to modernize existing relational workloads by addressing the requirements of new applications while supporting features like multi-document ACID transactions.
Features of MongoDB:
These are some important features of MongoDB:
Advantages of MongoDB:
At a high level, MongoDB enables developers that use data (which is most of us) to build easily, adapt quickly, and scale reliably. Let’s break that down:
Flexible Document Schemas
MongoDB’s document model allows virtually any kind of data structure to be modeled and manipulated easily. MongoDB’s BSON data format, inspired by JSON, allows you to have objects in one collection have different sets of fields (say, a middle name on a user only when applicable, or region-specific information that only applies to some records).
MongoDB supports creating explicit schemas and validating data so it doesn’t get out of control, but this flexibility is an incredible asset when handling real-world data, and handling changes in requirements or environment.
Code-native data access
Most databases force you to use heavy wrappers, like ORMs (Object Relational Mappers), to get data into Object form for use in programs. MongoDB’s decision to store and represent data in a document format means that you can access it from any language, in data structures that are native to that language (e.g. dictionaries in Python, associative arrays in JavaScript, Maps in Java, etc.).
Change-friendly design
If you’re used to having to bring down your site or application in order to change the structure of your data, you’re in luck: MongoDB is designed for change.
We spend a lot of time and effort designing efficient processes and learning from our mistakes, but typically the database is slowing the whole thing down. There’s no downtime required to change schemas, and you can start writing new data to MongoDB at any time, without disrupting its operations.
Powerful querying and analytics
What good is a database if you can’t find things inside it? MongoDB is designed to make data easy to access, and rarely to require joins or transactions, but when you need to do complex querying, it’s more than up to the task.
The MongoDB Query Language (MQL) is a full-featured, powerful language that allows you to query deep into documents, and even perform complex analytics pipelines with just a few lines of JSON-like MQL.
Easy horizontal scale-out
How MongoDB Stores Data?
As you know, RDMS stores data in tables format and uses structured query language (SQL) to query databases. RDBMS also has a 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 documents in MongoDB) simply by adding new fields or deleting existing ones. This ability of MongoDB helps you to represent hierarchical relationships, 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.
Who is Using MongoDB?
In today’s IT industry, there is a large number of companies that are using MongoDB as a database service for applications or data storage systems. As per the survey made by Siftery on MongoDB, there are around 4000+ companies confirmed that they are using MongoDB as Database. Some of the key names are :
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?spheres.
CASE STUDY OF ELECTRONIC ARTS WITH MONGODB
Electronic Arts’ EA Sports FIFA, the world’s best-selling sports video game franchise. EA Sports FIFA offers otherwise average athletes the chance to take on and beat the world’s best, weaving intricate passing plays and mastering Messi-Esque dribbling with the flick of a controller.
All without leaving the comfort of their couch.
Not everyone chooses to play FIFA on their Xbox or Playstation, however. Throughout Asia one of the most popular ways to bend it like Beckham is with EA’s FIFA Online 3. The massively multiplayer online soccer game is the most popular sports game in Korea, allowing players to choose to play and customize a team from any of over 30 leagues and 15,000 real-world players.
Because EA FIFA Online 3, developed by Spearhead, one of EA’s leading development studios, needs to scale to millions of players, Spearhead built the game to run on MongoDB, the industry’s most scalable database. EA already runs 250 MongoDB servers, spread across 80 shards. As EA FIFA Online 3 continues to grow in popularity, EA expects MongoDB’s auto sharding and other features to make it simple to scale.
Not content to win accolades on the field, EA FIFA Online 3 has also garnered honors from the industry, most recently winning a MongoDB Innovation Award, due to its creative use of MongoDB.
Even better, EA’s Spearhead, recipient of the $2,500 award for its work, donated it to the Park Ji-sung JS Foundation. Park, who played for years for Manchester United and tormented Arsenal defenses, “congratulate Spearhead on the great performance of FIFA Online 3,” performance enabled by its underlying MongoDB data infrastructure.
In addition to EA, Kixeye and a variety of other gaming companies use MongoDB to improve the gaming experience.
MongoDB Limitations
Since, in the above section, we discuss mainly the advantages of MongoDB. But in spite of these benefits, MongoDB also has some limitations like :
Conclusion:
NoSQL systems offer much less functionality than traditional relational database management systems, especially in transaction isolation and scan operations. But they can be successfully used when complex database logic is not, but large-scale, the distributed operation is an objective.??MongoDB is an effective document-oriented database that can be used for tweet analysis and other applications. JSON format of data stored in MongoDB helps in analyzing the data easily for further processing.??In the future, we can analyze more features of MongoDB and compare them with NoSQL.
In this article, we’ve also learned how Electronic Arts achieved a rapid digital transformation to improve its capabilities and meet the business’s demands faster.?What features and benefits MongoDB provides enterprises to solve their problems and much more,
So, we also learned that how Company’s like Electronic Arts Group uses MongoDB to solve the challenges of software development operations.
Thanks for reading the article.
Hope this article helpful to you!!!!
You can appreciate the article by giving it a like and posting comments about your feedback.