SlideShare a Scribd company logo
Sigit Kurniawan, M.Kom
MongoDB
Contents
• SQL vs NoSQL
• NoSQL Features & Types
• What is MongoDB?
• MongoDB Features
• MongoDB Data Types
• Installation MongoDB on Windows
• MongoDB CRUD Operations
• Node.js with MongoDB
SQL vs NoSQL
SQL VS NoSQL
• NoSQL (often interpreted as Not only SQL) database
• It provides a mechanism for storage and retrieval of data that is modeled
in means other than the tabular relations used in relational databases.
SQL NoSQL
Relational Database Management System (RDBMS) Non-relational or distributed database system.
These databases have fixed or static or predefined schema They have dynamic schema
These databases are best suited for complex queries These databases are not so good for complex queries
Vertically Scalable Horizontally scalable
Follows ACID property Follows BASE property
SQL VS NoSQL
• ACID Properties:
1. Atomicity; The entire transaction
takes place at once or doesn't
happen at all
2. Consistency; The database is
consistent before and after the
transaction
3. Isolation; Multiple transactions
occur independently without
interference
4. Durability; The changes of
successful transaction occurs even if
the systems failure occurs
Relational Databases
Durability
Isolation
Atomicity Consistency
ACID
SQL VS NoSQL
• CAP Properties:
1. Consistency; that the nodes will have
the same copies of a replicated data
item visible for various transactions
2. Availability; that each read or write
request for a data item will either be
processed successfully or will receive a
message that the operation cannot be
completed
3. Partition tolerance; the system can
continue operating even if the
network connecting the nodes has a
fault that results in two or more
partitions, where the nodes in each
partition can only communicate
among each other.
NoSQL Databases
Consistency
Availability
Partition tolerance
CAP
NoSQL Features & Types
NoSQL Features & Types
Fexible Schemas
Horizotal scaling
Fast queries due
to the data model
Ease of use for
developers
FEATURES
NoSQL Features & Types
Fexible Schemas
Horizotal scaling
Fast queries due
to the data model
Ease of use for
developers
FEATURES
Document
databases
Wide-column
stores
Key-value
databases
Graph databases
TYPES
What is MongoDB?
What is MongoDB ?
A database management
system designed to
rapidly develop web
applications and internet
infrastructure.
A general-purpose
document database
designed for modern
application development
and for the cloud.
A good NoSQL document
database with a range of
features that, in the
open-source NoSQL
world, are hard to beat.
What is MongoDB ?
A database management
system designed to
rapidly develop web
applications and internet
infrastructure.
A general-purpose
document database
designed for modern
application development
and for the cloud.
A good NoSQL document
database with a range of
features that, in the
open-source NoSQL
world, are hard to beat.
Document-Oriented,
No Sequel (NoSQL)
What is MongoDB ?
Database Collections
MongoDB stores data
as JSON/BSON (Binary
JSON) documents
In MongoDB, a
collection is a group of
documents
MongoDB Features
MongoDB Features
High
Performance
Auto
Replication
Horizontal
Scalability
Load
Balancing
High
Availability
Indexing
MongoDB Data Types
MongoDB Data Types
• String
This is the most commonly used datatype to store the data. String in MongoDB must be
UTF-8 valid.
• Integer
This type is used to store a numerical value. Integer can be 32 bit or 64 bit depending
upon your server.
• Double
This type is used to store floating point values.
• Date
This datatype is used to store the current date or time in UNIX time format. You can
specify your own date time by creating object of Date and passing day, month, year
into it.
• Boolean
This type is used to store a boolean (true/ false) value.
MongoDB Data Types
• Object ID
This datatype is used to store the document’s ID.
• Array
This type is used to store arrays or list or multiple values into one key.
• Timestamp
ctimestamp. This can be handy for recording when a document has been modified or
added.
• Code
This datatype is used to store JavaScript code into the document.
• Regular Expression
This datatype is used to store regular expression.
Installation MongoDB on Windows
Installation on Windows
• Step 1: Go to MongoDB download Page
and click download as shown in the
screenshot. A .msi file like this
mongodb-win32-x86_64-2008plus-ssl-
3.4.7-signed will be downloaded in
your system. Double click on the file to
run the installer.
Installation on Windows
• Step 2: Click Run when the MongoDB
installation windows pops up.
Installation on Windows
• Step 3: Click Next when the MongoDB
installation windows pops up.
Installation on Windows
• Step 4: Accept the MongoDB user
Agreement and click Next.
Installation on Windows
• Step 5: When the setup asks you to
choose the Setup type, choose
Complete.
Installation on Windows
• Step 6: Click Next when the MongoDB
service configuration. MongoDB will be
installed in the windows service
Installation on Windows
• Step 7: Choose Install MongoDB
Compass if you want to use the
MongoDB User Interface, or ignore it
and continue by clicking Next in the
Install MongoDB Compass window
Installation on Windows
• Step 8: Click Install to begin the
installation.
MongoDB CRUD Operations
MongoDB CRUD
RDBMS MongoDB
Database Database
Table Collection
Tuple/Row Document
column Field
Table Join Embedded Documents
Primary Key
Primary Key
(Default key _id provided by MongoDB itself)
MongoDB CRUD
CREATE DATABASE
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.
SQL Create Database
• SQL Server
CREATE DATABASE databasename;
Example: CREATE DATABASE testdb;
• MySQL
CREATE DATABASE databasename;
Example: CREATE DATABASE testdb;
MongoDB CRUD
INSERT DOCUMENT
Single Insert Multiple Insert
SQL Insert Query
• SQL Server
 Single
INSERT INTO tablename (c1,c2,...)
VALUES (v11,v12,...);
 Multiple
INSERT INTO tablename (c1,c2,...)
VALUES (v11,v12,...), (v21,v22,...), ….. , (vnn,vn2,...);
• MySQL
 Single
INSERT INTO tablename (c1,c2,...)
VALUES (v11,v12,...);
 Multiple
INSERT INTO tablename (c1,c2,...)
VALUES (v11,v12,...), (v21,v22,...), ….. , (vnn,vn2,...);
MongoDB CRUD
INSERT DOCUMENT - SINGLE
MongoDB CRUD
INSERT DOCUMENT - MULTIPLE
MongoDB CRUD
QUERY DOCUMENTS
Select All Documents
Specify Equality
Specify Conditions Using Query Operators
SELECT * FROM tablename;
SELECT * FROM tablename WHERE column;
SELECT * FROM tablename WHERE columnname IN ;
MongoDB CRUD
SELECT ALL DOCUMENTS
MongoDB CRUD
SPECIFY EQUALITY
MongoDB CRUD
SPECIFY CONDITIONS USING
QUERY OPERATORS
MongoDB CRUD
QUERY DOCUMENTS
Specify “AND” Conditions
Specify “OR” Conditions
Specify “AND” as well as “OR” Conditions
MongoDB CRUD
SPECIFY “AND” CONDITIONS
MongoDB CRUD
SPECIFY “OR” CONDITIONS
MongoDB CRUD
SPECIFY “AND” AS WELL AS “OR” CONDITIONS
MongoDB CRUD
UPDATES DOCUMENTS
Single Update Updates a single
document within the
collection based on
the filter.
SQL Update Query
• SQL Server
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
• MySQL
UPDATE table_name
SET
column_name1 = expr1,
column_name2 = expr2,
...
WHERE condition;
MongoDB CRUD
UPDATES DOCUMENTS
MongoDB CRUD
UPDATES DOCUMENTS
Multiple Update
Updates all documents
that match the specified
filter for a collection.
MongoDB CRUD
UPDATES DOCUMENTS
MongoDB CRUD
UPDATES DOCUMENTS
Replace One
Replaces a single
document within the
collection based on the
filter.
MongoDB CRUD
UPDATES DOCUMENTS
MongoDB CRUD
DELETE DOCUMENTS
Single Delete
SQL Delete Query
• SQL Server
DELETE FROM table_name WHERE condition;
• MySQL
DELETE FROM table_name WHERE condition;
MongoDB CRUD
DELETE DOCUMENTS
MongoDB CRUD
DELETE DOCUMENTS
Multiple Delete
MongoDB CRUD
DELETE DOCUMENTS
Node.js with MongoDB
MongoDB.pptx

More Related Content

What's hot

Mongo db intro.pptx
Mongo db intro.pptxMongo db intro.pptx
Mongo db intro.pptx
JWORKS powered by Ordina
 
Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]
Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]
Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]
MongoDB
 
Non Relational Databases
Non Relational DatabasesNon Relational Databases
Non Relational Databases
Chris Baglieri
 
MongoDB
MongoDBMongoDB
Sql vs NoSQL
Sql vs NoSQLSql vs NoSQL
Sql vs NoSQL
RTigger
 
Mongo DB
Mongo DB Mongo DB
Getting started with postgresql
Getting started with postgresqlGetting started with postgresql
Getting started with postgresql
botsplash.com
 
Introduction to redis
Introduction to redisIntroduction to redis
Introduction to redis
NexThoughts Technologies
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
Arnab Mitra
 
Copy of MongoDB .pptx
Copy of MongoDB .pptxCopy of MongoDB .pptx
Copy of MongoDB .pptx
nehabsairam
 
Intro To MongoDB
Intro To MongoDBIntro To MongoDB
Intro To MongoDB
Alex Sharp
 
When to Use MongoDB
When to Use MongoDBWhen to Use MongoDB
When to Use MongoDB
MongoDB
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
Habilelabs
 
Introduction to NoSQL Databases
Introduction to NoSQL DatabasesIntroduction to NoSQL Databases
Introduction to NoSQL DatabasesDerek Stainer
 
SQL vs. NoSQL Databases
SQL vs. NoSQL DatabasesSQL vs. NoSQL Databases
SQL vs. NoSQL Databases
Osama Jomaa
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
NodeXperts
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
Harri Kauhanen
 
NOSQL and MongoDB Database
NOSQL and MongoDB DatabaseNOSQL and MongoDB Database
NOSQL and MongoDB Database
Tariqul islam
 
The Basics of MongoDB
The Basics of MongoDBThe Basics of MongoDB
The Basics of MongoDB
valuebound
 

What's hot (20)

Mongo db intro.pptx
Mongo db intro.pptxMongo db intro.pptx
Mongo db intro.pptx
 
Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]
Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]
Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]
 
Non Relational Databases
Non Relational DatabasesNon Relational Databases
Non Relational Databases
 
MongoDB
MongoDBMongoDB
MongoDB
 
Sql vs NoSQL
Sql vs NoSQLSql vs NoSQL
Sql vs NoSQL
 
Mongo DB
Mongo DB Mongo DB
Mongo DB
 
Getting started with postgresql
Getting started with postgresqlGetting started with postgresql
Getting started with postgresql
 
Introduction to redis
Introduction to redisIntroduction to redis
Introduction to redis
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
Copy of MongoDB .pptx
Copy of MongoDB .pptxCopy of MongoDB .pptx
Copy of MongoDB .pptx
 
Intro To MongoDB
Intro To MongoDBIntro To MongoDB
Intro To MongoDB
 
When to Use MongoDB
When to Use MongoDBWhen to Use MongoDB
When to Use MongoDB
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
 
Introduction to NoSQL Databases
Introduction to NoSQL DatabasesIntroduction to NoSQL Databases
Introduction to NoSQL Databases
 
SQL vs. NoSQL Databases
SQL vs. NoSQL DatabasesSQL vs. NoSQL Databases
SQL vs. NoSQL Databases
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
RDBMS vs NoSQL
RDBMS vs NoSQLRDBMS vs NoSQL
RDBMS vs NoSQL
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
 
NOSQL and MongoDB Database
NOSQL and MongoDB DatabaseNOSQL and MongoDB Database
NOSQL and MongoDB Database
 
The Basics of MongoDB
The Basics of MongoDBThe Basics of MongoDB
The Basics of MongoDB
 

Similar to MongoDB.pptx

Mongo db
Mongo dbMongo db
Mongo db
Gyanendra Yadav
 
Mongo DB at Community Engine
Mongo DB at Community EngineMongo DB at Community Engine
Mongo DB at Community Engine
Community Engine
 
MongoDB at community engine
MongoDB at community engineMongoDB at community engine
MongoDB at community engine
mathraq
 
MongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data scienceMongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data science
bitragowthamkumar1
 
Introduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDBIntroduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDB
Ahmed Farag
 
Mongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorialMongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorial
Mohan Rathour
 
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
Hariharan Ganesan
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Stiliyan Kanchev
 
Hybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS ApplicationsHybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS ApplicationsSteven Francia
 
SQL vs MongoDB
SQL vs MongoDBSQL vs MongoDB
SQL vs MongoDB
calltutors
 
Introduction to mongodb
Introduction to mongodbIntroduction to mongodb
Introduction to mongodb
Mohammed Ragab
 
Webinar: When to Use MongoDB
Webinar: When to Use MongoDBWebinar: When to Use MongoDB
Webinar: When to Use MongoDB
MongoDB
 
MongoDB
MongoDBMongoDB
No sq lv1_0
No sq lv1_0No sq lv1_0
No sq lv1_0
Tuan Luong
 
Mean stack
Mean stackMean stack
Mean stack
RavikantGautam8
 
A Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsA Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - Habilelabs
Habilelabs
 
Big Data, NoSQL with MongoDB and Cassasdra
Big Data, NoSQL with MongoDB and CassasdraBig Data, NoSQL with MongoDB and Cassasdra
Big Data, NoSQL with MongoDB and Cassasdra
Brian Enochson
 
NoSQL and MongoDB Introdction
NoSQL and MongoDB IntrodctionNoSQL and MongoDB Introdction
NoSQL and MongoDB Introdction
Brian Enochson
 
Database Multitenancy in Ruby
Database Multitenancy in RubyDatabase Multitenancy in Ruby
Database Multitenancy in Ruby
João Soares
 

Similar to MongoDB.pptx (20)

Mongo db
Mongo dbMongo db
Mongo db
 
Mongo DB at Community Engine
Mongo DB at Community EngineMongo DB at Community Engine
Mongo DB at Community Engine
 
MongoDB at community engine
MongoDB at community engineMongoDB at community engine
MongoDB at community engine
 
MongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data scienceMongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data science
 
Introduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDBIntroduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDB
 
Mongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorialMongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorial
 
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Hybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS ApplicationsHybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS Applications
 
SQL vs MongoDB
SQL vs MongoDBSQL vs MongoDB
SQL vs MongoDB
 
Introduction to mongodb
Introduction to mongodbIntroduction to mongodb
Introduction to mongodb
 
Webinar: When to Use MongoDB
Webinar: When to Use MongoDBWebinar: When to Use MongoDB
Webinar: When to Use MongoDB
 
MongoDB
MongoDBMongoDB
MongoDB
 
No sq lv1_0
No sq lv1_0No sq lv1_0
No sq lv1_0
 
Mean stack
Mean stackMean stack
Mean stack
 
A Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsA Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - Habilelabs
 
NoSql Databases
NoSql DatabasesNoSql Databases
NoSql Databases
 
Big Data, NoSQL with MongoDB and Cassasdra
Big Data, NoSQL with MongoDB and CassasdraBig Data, NoSQL with MongoDB and Cassasdra
Big Data, NoSQL with MongoDB and Cassasdra
 
NoSQL and MongoDB Introdction
NoSQL and MongoDB IntrodctionNoSQL and MongoDB Introdction
NoSQL and MongoDB Introdction
 
Database Multitenancy in Ruby
Database Multitenancy in RubyDatabase Multitenancy in Ruby
Database Multitenancy in Ruby
 

Recently uploaded

Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 

Recently uploaded (20)

Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 

MongoDB.pptx

  • 2. Contents • SQL vs NoSQL • NoSQL Features & Types • What is MongoDB? • MongoDB Features • MongoDB Data Types • Installation MongoDB on Windows • MongoDB CRUD Operations • Node.js with MongoDB
  • 4. SQL VS NoSQL • NoSQL (often interpreted as Not only SQL) database • It provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases. SQL NoSQL Relational Database Management System (RDBMS) Non-relational or distributed database system. These databases have fixed or static or predefined schema They have dynamic schema These databases are best suited for complex queries These databases are not so good for complex queries Vertically Scalable Horizontally scalable Follows ACID property Follows BASE property
  • 5. SQL VS NoSQL • ACID Properties: 1. Atomicity; The entire transaction takes place at once or doesn't happen at all 2. Consistency; The database is consistent before and after the transaction 3. Isolation; Multiple transactions occur independently without interference 4. Durability; The changes of successful transaction occurs even if the systems failure occurs Relational Databases Durability Isolation Atomicity Consistency ACID
  • 6. SQL VS NoSQL • CAP Properties: 1. Consistency; that the nodes will have the same copies of a replicated data item visible for various transactions 2. Availability; that each read or write request for a data item will either be processed successfully or will receive a message that the operation cannot be completed 3. Partition tolerance; the system can continue operating even if the network connecting the nodes has a fault that results in two or more partitions, where the nodes in each partition can only communicate among each other. NoSQL Databases Consistency Availability Partition tolerance CAP
  • 8. NoSQL Features & Types Fexible Schemas Horizotal scaling Fast queries due to the data model Ease of use for developers FEATURES
  • 9. NoSQL Features & Types Fexible Schemas Horizotal scaling Fast queries due to the data model Ease of use for developers FEATURES Document databases Wide-column stores Key-value databases Graph databases TYPES
  • 11. What is MongoDB ? A database management system designed to rapidly develop web applications and internet infrastructure. A general-purpose document database designed for modern application development and for the cloud. A good NoSQL document database with a range of features that, in the open-source NoSQL world, are hard to beat.
  • 12. What is MongoDB ? A database management system designed to rapidly develop web applications and internet infrastructure. A general-purpose document database designed for modern application development and for the cloud. A good NoSQL document database with a range of features that, in the open-source NoSQL world, are hard to beat. Document-Oriented, No Sequel (NoSQL)
  • 13. What is MongoDB ? Database Collections MongoDB stores data as JSON/BSON (Binary JSON) documents In MongoDB, a collection is a group of documents
  • 17. MongoDB Data Types • String This is the most commonly used datatype to store the data. String in MongoDB must be UTF-8 valid. • Integer This type is used to store a numerical value. Integer can be 32 bit or 64 bit depending upon your server. • Double This type is used to store floating point values. • Date This datatype is used to store the current date or time in UNIX time format. You can specify your own date time by creating object of Date and passing day, month, year into it. • Boolean This type is used to store a boolean (true/ false) value.
  • 18. MongoDB Data Types • Object ID This datatype is used to store the document’s ID. • Array This type is used to store arrays or list or multiple values into one key. • Timestamp ctimestamp. This can be handy for recording when a document has been modified or added. • Code This datatype is used to store JavaScript code into the document. • Regular Expression This datatype is used to store regular expression.
  • 20. Installation on Windows • Step 1: Go to MongoDB download Page and click download as shown in the screenshot. A .msi file like this mongodb-win32-x86_64-2008plus-ssl- 3.4.7-signed will be downloaded in your system. Double click on the file to run the installer.
  • 21. Installation on Windows • Step 2: Click Run when the MongoDB installation windows pops up.
  • 22. Installation on Windows • Step 3: Click Next when the MongoDB installation windows pops up.
  • 23. Installation on Windows • Step 4: Accept the MongoDB user Agreement and click Next.
  • 24. Installation on Windows • Step 5: When the setup asks you to choose the Setup type, choose Complete.
  • 25. Installation on Windows • Step 6: Click Next when the MongoDB service configuration. MongoDB will be installed in the windows service
  • 26. Installation on Windows • Step 7: Choose Install MongoDB Compass if you want to use the MongoDB User Interface, or ignore it and continue by clicking Next in the Install MongoDB Compass window
  • 27. Installation on Windows • Step 8: Click Install to begin the installation.
  • 29. MongoDB CRUD RDBMS MongoDB Database Database Table Collection Tuple/Row Document column Field Table Join Embedded Documents Primary Key Primary Key (Default key _id provided by MongoDB itself)
  • 30. MongoDB CRUD CREATE DATABASE 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.
  • 31. SQL Create Database • SQL Server CREATE DATABASE databasename; Example: CREATE DATABASE testdb; • MySQL CREATE DATABASE databasename; Example: CREATE DATABASE testdb;
  • 32. MongoDB CRUD INSERT DOCUMENT Single Insert Multiple Insert
  • 33. SQL Insert Query • SQL Server  Single INSERT INTO tablename (c1,c2,...) VALUES (v11,v12,...);  Multiple INSERT INTO tablename (c1,c2,...) VALUES (v11,v12,...), (v21,v22,...), ….. , (vnn,vn2,...); • MySQL  Single INSERT INTO tablename (c1,c2,...) VALUES (v11,v12,...);  Multiple INSERT INTO tablename (c1,c2,...) VALUES (v11,v12,...), (v21,v22,...), ….. , (vnn,vn2,...);
  • 36. MongoDB CRUD QUERY DOCUMENTS Select All Documents Specify Equality Specify Conditions Using Query Operators SELECT * FROM tablename; SELECT * FROM tablename WHERE column; SELECT * FROM tablename WHERE columnname IN ;
  • 39. MongoDB CRUD SPECIFY CONDITIONS USING QUERY OPERATORS
  • 40. MongoDB CRUD QUERY DOCUMENTS Specify “AND” Conditions Specify “OR” Conditions Specify “AND” as well as “OR” Conditions
  • 43. MongoDB CRUD SPECIFY “AND” AS WELL AS “OR” CONDITIONS
  • 44. MongoDB CRUD UPDATES DOCUMENTS Single Update Updates a single document within the collection based on the filter.
  • 45. SQL Update Query • SQL Server UPDATE table_name SET column1 = value1, column2 = value2, ... WHERE condition; • MySQL UPDATE table_name SET column_name1 = expr1, column_name2 = expr2, ... WHERE condition;
  • 47. MongoDB CRUD UPDATES DOCUMENTS Multiple Update Updates all documents that match the specified filter for a collection.
  • 49. MongoDB CRUD UPDATES DOCUMENTS Replace One Replaces a single document within the collection based on the filter.
  • 52. SQL Delete Query • SQL Server DELETE FROM table_name WHERE condition; • MySQL DELETE FROM table_name WHERE condition;

Editor's Notes

  1. MongoDB memberikan kinerja tinggi (High Performance). Sebagian besar operasi di MongoDB lebih cepat dibandingkan dengan database relasional. MongoDB menyediakan fitur replikasi otomatis (Auto Replication) yang memungkinkan Anda memulihkan data dengan cepat jika terjadi kegagalan. Penskalaan horizontal (Horizontal Scalability) dimungkinkan di MongoDB karena berbagi. Sharding adalah mempartisi data dan menempatkannya di beberapa mesin sedemikian rupa sehingga urutan data dipertahankan. Penskalaan horizontal vs penskalaan vertikal: Penskalaan vertikal berarti menambahkan lebih banyak sumber daya ke mesin yang ada sementara penskalaan horizontal berarti menambahkan lebih banyak mesin untuk menangani data. Penskalaan vertikal tidak mudah diimplementasikan, di sisi lain penskalaan horizontal mudah diimplementasikan. Contoh basis data penskalaan horizontal: MongoDB, Cassandra dll. Penyeimbangan beban (Load Balancing): Penskalaan horizontal memungkinkan MongoDB untuk menyeimbangkan beban. Ketersediaan Tinggi (High Avalaibility): Replikasi Otomatis meningkatkan ketersediaan database MongoDB. Pengindeksan (Indexing): Indeks adalah bidang tunggal dalam dokumen. Indeks digunakan untuk menemukan data dengan cepat tanpa harus mencari setiap dokumen dalam database MongoDB. Ini meningkatkan kinerja operasi yang dilakukan pada database MongoDB.