0% found this document useful (0 votes)
0 views

DBA-2

The document provides an overview of MongoDB, a NoSQL database management system that utilizes flexible document structures for data storage and processing. It compares MongoDB with other databases like MySQL and Cassandra, highlighting its advantages in flexibility, performance, and scalability for various use cases such as mobile applications and real-time analytics. Additionally, it discusses MongoDB Shell, its features, and commands for database management, as well as instructions for connecting MongoDB to Visual Studio Code.

Uploaded by

Kavya Motakatla
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

DBA-2

The document provides an overview of MongoDB, a NoSQL database management system that utilizes flexible document structures for data storage and processing. It compares MongoDB with other databases like MySQL and Cassandra, highlighting its advantages in flexibility, performance, and scalability for various use cases such as mobile applications and real-time analytics. Additionally, it discusses MongoDB Shell, its features, and commands for database management, as well as instructions for connecting MongoDB to Visual Studio Code.

Uploaded by

Kavya Motakatla
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 19

SCHOOL OF COMPUTER SCIENCE

ENGINEERING AND TECHNOLOGY


COURSE NAME: BIG DATA ANALYTICS
COURSE CODE: SWE2011
SLOT: D1+TD1
DIGITAL
ASSIGNMENT-1

NAME:M.KAVYA SREE

REGISTER NUMBER:22MIS0456

FACULTY: SRINIVAS KOPPU


MongoDB
MongoDB is an open source, nonrelational database management system
(DBMS) that uses flexible documents instead of tables and rows to process
and store various forms of data.
As a NoSQL database solution, MongoDB does not require a relational
database management system (RDBMS), so it provides an elastic data
storage model that enables users to store and query multivariate data
types with ease. This not only simplifies database management for
developers but also creates a highly scalable environment for cross-
platform applications and services.
MongoDB documents or collections of documents are the basic units of
data. Formatted as Binary JSON (Java Script Object Notation), these
documents can store various types of data and be distributed across
multiple systems. Since MongoDB employs a dynamic schema design,
users have unparalleled flexibility when creating data records, querying
document collections through MongoDB aggregation and analyzing large
amounts of information.

Comparing MongoDB to other databases


With so many database management solutions currently available, it can
be hard to choose the right solution for your enterprise. Here are some
common solution comparisons and best use cases that can help you
decide.

MongoDB vs. MySQL


MySQL uses a structured query language to access stored data. In this
format, schemas are used to create database structures, utilizing tables
as a way to standardize data types so that values are searchable and can
be queried properly. A mature solution, MySQL is useful for a variety of
situations including website databases, applications and commercial
product management.
Because of its rigid nature, MySQL is preferable to MongoDB when data
integrity and isolation are essential, such as when managing transactional
data. But MongoDB’s less-restrictive format and higher performance make
it a better choice, particularly when availability and speed are primary
concerns.

MongoDB vs. Cassandra


While Cassandra and MongoDB are both considered NoSQL databases,
they have different strengths. Cassandra uses a traditional table structure
with rows and columns, which enables users to maintain uniformity and
durability when formatting data before it’s compiled.
Cassandra can offer an easier transition for enterprises looking for a
NoSQL solution because it has a syntax similar to SQL; it also reliably
handles deployment and replication without a lot of configuration.
However, it can’t match MongoDB’s flexibility for handling structured and
unstructured data sets or its performance and reliability for mission-
critical cloud applications.

MongoDB use cases


Mobile applications
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.

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.

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.

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.

Mongo DB benefits
Over the years, MongoDB has become a trusted solution for many
businesses that are looking for a powerful and highly scalable NoSQL
database. But MongoDB is much more than just a traditional document-
based database and it boasts a few great capabilities that make it stand
out from other DBMS.

Load balancing
As enterprises' cloud applications scale and resource demands increase,
problems can arise in securing the availability and reliability of services.
MongoDB’s load balancing sharing process distributes large data sets
across multiple virtual machines at once while still maintaining acceptable
read and write throughputs. This horizontal scaling is called sharding and
it helps organizations avoid the cost of vertical scaling of hardware while
still expanding the capacity of cloud-based deployments.

Ad hoc database queries


One of MongoDB’s biggest advantages over other databases is its ability
to handle ad hoc queries that don’t require predefined schemas. MongoDB
databases use a query language that’s similar to SQL databases and is
extremely approachable for beginner and advanced developers alike. This
accessibility makes it easy to push, query, sort, update and export your
data with common help methods and simple shell commands.

Multilanguage support
One of the great things about MongoDB is its multilanguage support.
Several versions of MongoDB have been released and are in continuous
development with driver support for popular programming languages,
including Python, PHP, Ruby, Node.js, C++, Scala, JavaScript and many
more.

MongoDB Shell

MongoDB Shell is a powerful, interactive command-line interface that
enables developers and database administrators to perform
operations and manage their MongoDB databases using JavaScript
syntax. Whether you're a beginner just starting with MongoDB or an
experienced user, MongoDB Shell offers a comprehensive environment
for executing queries, testing commands, and handling database
tasks.
MongoDB Shell is a JavaScript-based tool that allows users to interact
with MongoDB databases directly from the command line. It facilitates a
wide range of operations from simple CRUD (Create, Read, Update,
Delete) operations to more advanced database management tasks,
making it an essential tool for anyone working with MongoDB.
MongoDB Shell allows developers to:
 Perform CRUD operations
 Query databases using rich syntax
 Execute aggregation queries for data analysis
 Handle large datasets efficiently
 Interact with the database in real-time using an interactive
interface
MongoDB Shell Interface
The MongoDB Shell provides a direct interface between users and
their MongoDB databases, making it easier to perform a wide variety of
tasks. It simplifies operations like:
 Creating and deleting databases
 Inserting and modifying documents
 Running complex queries
 Managing collections
The interface uses JavaScript syntax, which allows developers to take
advantage of its flexibility and execute complex queries. The immediate
feedback and command history support make it perfect for
both beginners and advanced users.
Key Features of MongoDB Shell
MongoDB Shell comes packed with essential features that enhance the
database management experience. Here are some key highlights:
 Interactive Environment: MongoDB Shell offers an interactive
experience where you can enter commands and see immediate
results, making it ideal for learning and testing.
 JavaScript-Based: Since the shell uses JavaScript, you can
leverage its rich capabilities to manipulate data and execute
complex queries.
 Support for CRUD Operations: It perform
all Create, Read, Update and Delete (CRUD) operations
effortlessly through the shell.
 Aggregation Framework: Access advanced data processing
features using the aggregation framework.
 Cross-Platform Compatibility: It use MongoDB Shell on
various operating systems, including Windows, macOS and
Linux.
TO CONNECT MONGODB TO VS CODE

Install the mongodb extension in vs code

Then click on connect


Then right click on localhost:27017 and click on launch MongoDBshell

Commands
To view the list of databases

we can switch the database using

To create new database

To drop the current Database

To insert one item into database

To insert many items into database


To return all documents in database

To sort items by alphabetic order

To sort items by experience in ascending order


To sort items by alphabetic descending order

To limit the documents

To find the item with highest experience


To find the item with lowest experience

Queries to find items by its attributes


To get the unique objectID

To update the item in the collection

updated

using update many


To delete an item from collection

To return item where name is not equal to teja

To return item with experience less than or equal to 10

To do same using MongoDBCompass

To create new database click on plus symbol and then give the name of
database
To delete a database click on three dots and then click remove option

To add the data into database click on add data and then select either
import JSON or CSV file or insert document
To sort using mangoDBCompass click on options

to sort in alphabetic order

To sort in reverse alphabetical order


TO find element using attribute name

To find element using attribute experience

To get the objectID of items which has name


To update the items
Exporting files from MongoDBCompass

You might also like