SlideShare a Scribd company logo
prepared for: 20/20 Companies | 8.22.2010
NoSQL - MongoDB
version 1.0
Presenter: Shiv K Sah
Department: OST
Designation: Technical Lead
prepared for: 20/20 Companies | 8.22.2010
Agenda
❖ NoSQL Introduction & Overview
❖ MongoDB Introduction & Overview
❖ Why MongoDB
❖ Relationship of RDBMS terminology with MongoDB
❖ Installing server and tools
❖ The Mongo Shell
❖ CRUD (Creating, Reading and Updating Data)
❖ Aggregation Framework
❖ Schema Design - Patterns
❖ Replication
❖ Sharding
❖ Use case studies of Analytic Application'
prepared for: 20/20 Companies | 8.22.2010
NoSQL : “Not Only SQL”
prepared for: 20/20 Companies | 8.22.2010
NoSQL Introduction
● NoSQL database, also called Not Only SQL, is an approach to data
management and database design that's useful for very large sets of
distributed data.
● A NoSQL database provides a mechanism for storage and retrieval of data
that is modeled in means other than the tabular relations used in traditional
relational databases.
● NoSQL (not only SQL) - a number of approaches and projects aimed for the
implementation of database models, with significant differences from those
that used in traditional relational database management system with access to
the data with the help of SQL. Description schema in the case of NoSQL can
be carried out through the use of different data structures: hash tables, arrays,
trees, etc.
● For the first time the term "NoSQL" was used in the late 90's.
● Now there are about 150 kinds of NoSQL databases (nosql-database.org)
prepared for: 20/20 Companies | 8.22.2010
NoSQL Overview
prepared for: 20/20 Companies | 8.22.2010
Types of NoSQL databases
● Key-Value databases: CouchDB, Oracle NoSQL Database, MemcacheDB,
DynamoDB(Amazon), FoundationDB, HyperDex, Redis, Riak, OrientDB,
FairCom c-treeACE, Aerospike, MUMPS
● Document databases: MongoDB, Apache CouchDB, Couchbase, HyperDex,
MarkLogic, Lotus Notes, Clusterpoint, OrientDB, Qizx
● Column-family databases: Accumulo, Cassandra, Druid, HBase, Vertica
● Graph databases: Allegro, Neo4J, InfiniteGraph, OrientDB, Virtuoso, Stardog
● Multi-model: OrientDB, FoundationDB, ArangoDB, Alchemy Database,
CortexDB
● Migrations, Polyglot persistence and more
prepared for: 20/20 Companies | 8.22.2010
prepared for: 20/20 Companies | 8.22.2010
Types of NoSQL databases
prepared for: 20/20 Companies | 8.22.2010
Advantage of using NoSQL
● Quicker development times, this is due to aggregates, meaning you write to the
database once, instead of multiple times for individual entities.
● Easy to scale where relational databases are meant for a single server.
● Prevents having to create tables with custom columns like custom1, custom2,
etc. This is due to all NoSQL databases being schema-less
● Prevents having tables with large amounts of NULL values (sparse table).
● It’s More Scalable
● It’s Flexible
● It’s Administrator-Friendly
● It’s Cost-Effective and Open-Source
● The Cloud’s the Limit
prepared for: 20/20 Companies | 8.22.2010
Disadvantages of using NoSQL
● It Has a Very Narrow Focus
● Standardization and Open Source
● Performance and Scaling > Consistency
● A General Lack of Maturity
● It Doesn’t Play Nice with Analytics
● No relations between the tables(collections in mongodb).
● No Stored Procedures in mongodb (NoSql database).
● Most of the administration is depends upon scripting like bash,perl etc.,
in linux environment.
● GUI mode tools to access the database is not flexibly available in
market.
prepared for: 20/20 Companies | 8.22.2010
MongoDB (from humongous)
prepared for: 20/20 Companies | 8.22.2010
● It is a Open Source, cross platform database written in C++.
● It is a document oriented database that provides, high performance, high
availability, and easy scalability.
● It stores data as documents. So it is a document oriented database.
● It does not support SQL It supports a rich, ad-hoc query language of its own.
● It works on concept of collection and document.
There are few organizations migrated to MongoDb and it proven benefits to them:. These are:
What is a MongoDB?
Organization Migrated From Application
MTV Networks Multiple RDBMS Centralized content management
Cisco Multiple RDBMS Analytics, social networking
Foursquare PostgreSQL Social, mobile networking platforms
Salesforce marketing Cloud RDBMS Social marketing, analytics
Orange Digital MySQL Content management
edmunds.com Oracale Billing, online advertising, user data
prepared for: 20/20 Companies | 8.22.2010
Basic Overview
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. Collections do not enforce a schema.
Documents within a collection can have different
fields.
Document: A document is a set of key-value
pairs. 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.
prepared for: 20/20 Companies | 8.22.2010
● Schema less : MongoDB is document database in which one collection holds
different different documents. Number of fields, content and size of the
document can be differ from one document to another.
● You can set an index on any attribute of a MongoDb record (as
FirstName="Sameer",Address="8 Gandhi Road"), with respect to which, a
record can be sort quickly and ordered.
● MongoDb supports various programming languages like C, C# and .NET,
C++, Erlang, Haskell, Java, Javascript, Perl, PHP, Python, Ruby, Scala (via
Casbah).
● MongoDb supports rich query to fetch the data.
● Data is stored in the form of JSON style documents.
● No complex joins
● MongoDb is easily installable.
Why MongoDB?
prepared for: 20/20 Companies | 8.22.2010
Features
● Document-oriented
● Ad hoc queries
● Indexing
● Replication
● Load balancing
● File storage
● Aggregation
● Server-side JavaScript execution
● Capped collections
● HTTP Server for REST API
prepared for: 20/20 Companies | 8.22.2010
How mongoDB works?
There is a process “mongod” that acts as a database server.
This process attaches itself to a directory with the --dbpath option.
(Default dbpath : “/data/db”).
And start listening to a specific port number via --port option.
(Default port : 27017, 28017 - Http interfaces)
Example:-
> .mongod.exe --dbpath "C:datadb" --port 28080
prepared for: 20/20 Companies | 8.22.2010
➢ JSON:- JSON (JavaScript Object Notation) is a lightweight data-interchange
format. It is easy for humans to read and write. It is easy for machines to
parse and generate. Its built on key value structure and ordered list of
values.
➢ BSON:- Binary JSON, is a binary-encoded serialization of JSON-like docu-
ments. It supports the embedding of documents and arrays within other doc-
uments and arrays. BSON also contains extensions that allow representa-
tion of data types that are not part of the JSON spec.
Characteristics:-
○ Lightweight: minimum overhead
○ Traversable
○ Efficient: encoding and decoding
Behind MongoDB - JSON / BSON
prepared for: 20/20 Companies | 8.22.2010
Behind MongoDB - JSON / BSON
prepared for: 20/20 Companies | 8.22.2010
MongoDB : Engine
➢ MMAP: For heavy read application
➢ WiredTiger: For heavy write applications.
prepared for: 20/20 Companies | 8.22.2010
MongoDB : Tools
➢ MongoDB Cloud Manager
➢ Robomongo
➢ MongoVUE
➢ MongoChef
➢ NoSQL Manager for MongoDB
➢ PHPMoAdmin
➢ PHPmongoDB
➢ mongobird
➢ Mongo Management Studio
➢ 3T MongoChef
➢ 3T Schema Explorer
➢ 3T Data Compare
prepared for: 20/20 Companies | 8.22.2010
Sample MongoDB Document
Below given example shows the document structure of a blog site which is simply a comma separated key value pair.
{ _id: ObjectId(7df78ad8902c)
title: 'MongoDB Overview',
description: 'MongoDB is no sql database',
by: 'tutorials point',
url: 'http://www.tutorialspoint.com',
tags: ['mongodb', 'database', 'NoSQL'],
likes: 100,
comments: [
{
user:'user1',
message: 'My first comment',
dateCreated: new Date(2011,1,20,2,15),
like: 0
},
{
user:'user2',
message: 'My second comments',
dateCreated: new Date(2011,1,25,7,45),
like: 5
}
]
}
Note:
_id is a 12 bytes hexadecimal number which
assures the uniqueness of every document.
You can provide _id while inserting the
document. If you didn't provide then
MongoDB provide a unique id for every
document. These 12 bytes first 4 bytes for the
current timestamp, next 3 bytes for machine
id, next 2 bytes for process id of mongodb
server and remaining 3 bytes are simple
incremental value.
prepared for: 20/20 Companies | 8.22.2010
Relationship of RDBMS terminology with MongoDB
Below given table shows the relationship of RDBMS terminology with MongoDB
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)
Database Server and Client
Mysqld/Oracle mongod
mysql/sqlplus mongo
prepared for: 20/20 Companies | 8.22.2010
➢ Download mongoDB from https://mongodb.org/downloads
➢ Install mongoDB (Manual: http://docs.mongodb.org/manual/installation)
➢ Configuration:
○ dbpath - /var/lib/mongo, /data/db
○ log path - /var/log/mongodb
○ Configuration file - /etc/mongod.conf, C:/mongodb/mongod.cfg
○ port - 27017, 28017
➢ Install mongod service
MongoDB Installation
prepared for: 20/20 Companies | 8.22.2010
➢ Authentication - Who are you in MongoDB?
○ Application user
○ Administrator
○ Backup job
○ Monitoring agents
➢ Authorization - What can you do in MongoDB?
○ CDUD Operation
○ Configure the database
○ Manage sharding/replication
○ User management
MongoDB Configuration
prepared for: 20/20 Companies | 8.22.2010
Manage User and Roles
➢ MongoDB employs Role-Based Access Control (RBAC) to determine access
for users
➢ MongoDb store user and roles details to admin database.
➢ Each application and user of a MongoDB system should map to a distinct
application or administrator
➢ MongoDB provide built-in roles like…
○ Database user role
■ read
■ readWrite
○ Database Administration Roles
■ dbAdmin
■ dbOwner
■ userAdmin
prepared for: 20/20 Companies | 8.22.2010
Create a system user administrator
use admin
db.createUser({
user: "root",
pwd: "root",
roles: ["root"]
})
db.createUser({
user: "siteUserAdmin",
pwd: "password",
roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
})
prepared for: 20/20 Companies | 8.22.2010
MongoDB : CRUD Example
➢ Create database “icreondb”
➢ Create collection
>use icreondb
switched to db icreondb
>db.createCollection("departments")
{ "ok" : 1 }
>db.departments.insert(
{
"name": "Open Source Technology",
"code": "OST",
"technology": ["PHP", "Python", "MySQL", "MongoDB"]
}
)
prepared for: 20/20 Companies | 8.22.2010
Collection : Insert document
prepared for: 20/20 Companies | 8.22.2010
Collection : Update document
prepared for: 20/20 Companies | 8.22.2010
Collection : Delete document
The following diagram shows the same query in SQL:
prepared for: 20/20 Companies | 8.22.2010
Collection : Find in collections
prepared for: 20/20 Companies | 8.22.2010
Collection : Find in collections
prepared for: 20/20 Companies | 8.22.2010
Collection : Filter Query
Comparison Operators
$eq Matches values that are equal to a specified value.
$gt Matches values that are greater than a specified value.
$gte Matches values that are greater than or equal to a
specified value.
$lt Matches values that are less than a specified value.
$lte Matches values that are less than or equal to a
specified value.
$ne Matches all values that are not equal to a specified
value.
$in Matches any of the values specified in an array.
$nin Matches none of the values specified in an array.
prepared for: 20/20 Companies | 8.22.2010
Collection : Filter Query
Logical Operators
$or Joins query clauses with a logical OR returns all documents that match
the conditions of either clause.
$and Joins query clauses with a logical AND returns all documents that
match the conditions of both clauses.
$not Inverts the effect of a query expression and returns documents that do
not match the query expression.
$nor Joins query clauses with a logical NOR returns all documents that fail
to match both clauses.
prepared for: 20/20 Companies | 8.22.2010
Collection : Filter Query
$exists Matches documents that have the specified field.
$type Selects documents if a field is of the specified type.
Element Operators
Array Operators
$all Matches arrays that contain all elements specified in the query.
$elemMatch Selects documents if element in the array field matches all the
specified $elemMatch conditions
$size Selects documents if the array field is a specified size.
prepared for: 20/20 Companies | 8.22.2010
Collection : Projection
Projection Operators
$ Projects the first element in an array that matches the query
condition.
$elemMatch Projects the first element in an array that matches the specified
$elemMatch condition.
$meta Projects the document’s score assigned during $text operation.
$slice Limits the number of elements projected from an array. Supports
skip and limit slices.
prepared for: 20/20 Companies | 8.22.2010
Aggregation Framework
➢ Aggregations are operations that process data records and return computed
results.
➢ MongoDB provides a rich set of aggregation operations that examine and
perform calculations on the data sets.
➢ Running data aggregation on the mongod instance simplifies application
code and limits resource requirements.
prepared for: 20/20 Companies | 8.22.2010
Aggregation Framework
prepared for: 20/20 Companies | 8.22.2010
Aggregation : Pipeline Operator
Name Description
$match Filter documents
$project Reshape document
$group Summarize document
$unwind Expand document
$sort Order document
$limit/$skip Pagination document
$redant Restrict document
$geoNear Proximity sort document
prepared for: 20/20 Companies | 8.22.2010
Zip document
{
"_id": "10280",
"city": "NEW YORK",
"state": "NY",
"pop": 5574,
"loc": [ -74.016323, 40.710537 ]
}
Report:
➢ States with Populations above 10 Million
➢ Average City Population by State
➢ Largest and Smallest Cities by State
Aggregation : Demo
prepared for: 20/20 Companies | 8.22.2010
SQL and the corresponding MongoDB statements
Statement MYSQL MONGODB
Create CREATE TABLE users ( id INT NOT NULL
AUTO_INCREMENT, user_id Varchar(30), age Number,
status char(1), PRIMARY KEY (id) )
db.users.insert( { user_id: "abc123", age: 55,
status: "A" } )
OR
db.createCollection("users")
Alter ALTER TABLE users ADD join_date DATETIME db.users.update( { }, { $set: { join_date: new
Date() } }, { multi: true } )
Drop Column ALTER TABLE users DROP COLUMN join_date db.users.update( { }, { $unset: { join_date: ""
} }, { multi: true } )
Drop Table DROP TABLE users db.users.drop()
Insert INSERT INTO users(user_id, age, status) VALUES
("bcd001", 45, "A")
db.users.insert( { user_id: "bcd001", age: 45,
status: "A" } )
Select SELECT user_id, status FROM users WHERE status = "A" db.users.find( { status: "A" }, { user_id: 1,
status: 1, _id: 0 } )
()
Update UPDATE users SET status = "C" WHERE age > 25 db.users.update( { age: { $gt: 25 } }, { $set: {
status: "C" } }, { multi: true } )
Delete DELETE FROM users WHERE status = "D" db.users.remove( { status: "D" } )
prepared for: 20/20 Companies | 8.22.2010
➢ What is a priority?
○ High consistency
○ High read performance
○ High write performance
➢ How does the application access and manipulate data?
○ Read/Write Ratio
○ Types of Queries / Updates
○ Data life-cycle and growth
○ Analytics (MapReduce, Aggregation)
Schema Design - Patterns
prepared for: 20/20 Companies | 8.22.2010
➢ One to One Relationship
○ Relationships are often embedded
○ Optimized read performance.
○ Document provides a holistic representation of objects with
embedded entities
➢ One to Many Relations
○ De-normalization
○ Provides data locality using Referencing or Embedding
➢ Many to Many Relations
○ Referencing and indexing
Schema Design - Example
prepared for: 20/20 Companies | 8.22.2010
Example: Blogging in MySQL* - MongoDB
prepared for: 20/20 Companies | 8.22.2010
Data Modeling in MongoDB
There are two tools that allow applications to represent these relationships: references and embedded documents.
References: References: References store the relationships between
data by including links or references from one document to another.
Applications can resolve these references to access the related data.
Embedded Data: Embedded documents capture
relationships between data by storing related data in a single
document structure. These denormalized data models allow
applications to retrieve and manipulate related data in a
single database operation.
User Document:
{
_id: <ObjectId1>,
username: "user1"
}
Contact Document:
{
_id: <ObjectId2>,
user_id: <ObjectId1>,
phone: "1234567890",
email: "user@example.com"
}
Access Document:
{
_id: <ObjectId3>,
user_id: <ObjectId1>,
level: 5,
group: "Dev"
}
{
_id: <ObjectId1>,
username: "user1",
contact: {
phone: "1234567890",
email: "user@example.com"
},
access: {
level: 5,
group: "Dev"
}
}
prepared for: 20/20 Companies | 8.22.2010
Replication
➢ A replica set in MongoDB
is a group of mongod
processes that maintain
the same data set
➢ Replica sets provide
redundancy and high
availability, and are the
basis for all production
deployments
prepared for: 20/20 Companies | 8.22.2010
Sharding
➢ Sharding is the process of storing
data records across multiple
machines and is MongoDB’s
approach to meeting the demands of
data growth.
➢ With sharding, you add more
machines to support data growth and
the demands of read and write
operations.
prepared for: 20/20 Companies | 8.22.2010
Database Design?
prepared for: 20/20 Companies | 8.22.2010
Further studies
➢ https://university.mongodb.com
➢ https://docs.mongodb.org/manual
➢ https://www.mongodb.com/presentations
prepared for: 20/20 Companies | 8.22.2010
Shiv Kumar Sah
Technical Lead
TechExpert@me.com
@shivkumarsah
Thank You
➢ Q & A
➢ Feedback

More Related Content

What's hot

MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)
Uwe Printz
 
MongoDB 2.4 and spring data
MongoDB 2.4 and spring dataMongoDB 2.4 and spring data
MongoDB 2.4 and spring data
Jimmy Ray
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
Habilelabs
 
MongoDB presentation
MongoDB presentationMongoDB presentation
MongoDB presentation
Hyphen Call
 
Mongo db basics
Mongo db basicsMongo db basics
Mongo db basics
Claudio Montoya
 
Mongo db intro.pptx
Mongo db intro.pptxMongo db intro.pptx
Mongo db intro.pptx
JWORKS powered by Ordina
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Mike Dirolf
 
Mongo DB
Mongo DB Mongo DB
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
César Trigo
 
MongoDB: An Introduction - june-2011
MongoDB:  An Introduction - june-2011MongoDB:  An Introduction - june-2011
MongoDB: An Introduction - june-2011
Chris Westin
 
Mongo db
Mongo dbMongo db
Mongo db
Akshay Mathur
 
CSCi226PPT1
CSCi226PPT1CSCi226PPT1
CSCi226PPT1
Mahima Verma
 
Mongo db workshop # 02
Mongo db workshop # 02Mongo db workshop # 02
Mongo db workshop # 02
FarhatParveen10
 
Mongodb intro
Mongodb introMongodb intro
Mongodb intro
christkv
 
Mongo DB
Mongo DBMongo DB
Document Database
Document DatabaseDocument Database
Document Database
Heman Hosainpana
 
Building Spring Data with MongoDB
Building Spring Data with MongoDBBuilding Spring Data with MongoDB
Building Spring Data with MongoDB
MongoDB
 
MongodB Internals
MongodB InternalsMongodB Internals
MongodB Internals
Norberto Leite
 
MongoDB
MongoDBMongoDB
MongoDB
nikhil2807
 
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorialsMongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
SpringPeople
 

What's hot (20)

MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)
 
MongoDB 2.4 and spring data
MongoDB 2.4 and spring dataMongoDB 2.4 and spring data
MongoDB 2.4 and spring data
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
 
MongoDB presentation
MongoDB presentationMongoDB presentation
MongoDB presentation
 
Mongo db basics
Mongo db basicsMongo db basics
Mongo db basics
 
Mongo db intro.pptx
Mongo db intro.pptxMongo db intro.pptx
Mongo db intro.pptx
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Mongo DB
Mongo DB Mongo DB
Mongo DB
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
 
MongoDB: An Introduction - june-2011
MongoDB:  An Introduction - june-2011MongoDB:  An Introduction - june-2011
MongoDB: An Introduction - june-2011
 
Mongo db
Mongo dbMongo db
Mongo db
 
CSCi226PPT1
CSCi226PPT1CSCi226PPT1
CSCi226PPT1
 
Mongo db workshop # 02
Mongo db workshop # 02Mongo db workshop # 02
Mongo db workshop # 02
 
Mongodb intro
Mongodb introMongodb intro
Mongodb intro
 
Mongo DB
Mongo DBMongo DB
Mongo DB
 
Document Database
Document DatabaseDocument Database
Document Database
 
Building Spring Data with MongoDB
Building Spring Data with MongoDBBuilding Spring Data with MongoDB
Building Spring Data with MongoDB
 
MongodB Internals
MongodB InternalsMongodB Internals
MongodB Internals
 
MongoDB
MongoDBMongoDB
MongoDB
 
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorialsMongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
 

Viewers also liked

Grand Canyon in Less than 100 Photos
Grand Canyon in Less than 100 PhotosGrand Canyon in Less than 100 Photos
Grand Canyon in Less than 100 Photos
Ryn Gargulinski
 
Tecnologias para la educación
Tecnologias para la educaciónTecnologias para la educación
Tecnologias para la educación
Iarozeth Piquero
 
El problema de la setmana andrea
El problema de la setmana andreaEl problema de la setmana andrea
El problema de la setmana andreaSerradePrades
 
Universidad tecnologica equinoccial solis villalta doris remache bunci manu...
Universidad tecnologica equinoccial  solis villalta doris  remache bunci manu...Universidad tecnologica equinoccial  solis villalta doris  remache bunci manu...
Universidad tecnologica equinoccial solis villalta doris remache bunci manu...
1986-06-26
 
Centrifuge 2014
Centrifuge 2014Centrifuge 2014
Centrifuge 2014
kels_147
 
Prueba
PruebaPrueba
Prueba
berzabeth
 
Matt hunter
Matt hunterMatt hunter
Matt hunter
MaFe Morales
 
Presentación del sistema genesis y portal institucional j a
Presentación del sistema genesis y portal institucional j aPresentación del sistema genesis y portal institucional j a
Presentación del sistema genesis y portal institucional j a
felipegomezg
 
Novas Tecnologias
Novas TecnologiasNovas Tecnologias
Novas Tecnologias
Ligimaca
 
OTS-US Staffing Services
OTS-US Staffing ServicesOTS-US Staffing Services
OTS-US Staffing Services
Shweta Madaan
 
Tout ce que le getting started MongoDB ne vous dira pas
Tout ce que le getting started MongoDB ne vous dira pasTout ce que le getting started MongoDB ne vous dira pas
Tout ce que le getting started MongoDB ne vous dira pas
Bruno Bonnin
 
Biochemistry sample
Biochemistry sampleBiochemistry sample
Biochemistry sample
medpgnotes ebooks
 
Tecnologia 3 d
Tecnologia 3 dTecnologia 3 d
Tecnologia 3 d
Aron Sporkens
 
4 mathematic03
4 mathematic034 mathematic03
4 mathematic03
JESUSDAVIDCARDONA
 
Drag Reduction in Commercial Vehicles: Major Project
Drag Reduction in Commercial Vehicles: Major ProjectDrag Reduction in Commercial Vehicles: Major Project
Drag Reduction in Commercial Vehicles: Major Project
JJ Technical Solutions
 
WBA Power Point Ready3
WBA Power Point Ready3WBA Power Point Ready3
WBA Power Point Ready3
asiwebdesigners
 
Inocencio meléndez julio. la contabilidad como herramienta de la administra...
 Inocencio meléndez julio. la contabilidad como herramienta de la administra... Inocencio meléndez julio. la contabilidad como herramienta de la administra...
Inocencio meléndez julio. la contabilidad como herramienta de la administra...
INOCENCIO MELÉNDEZ JULIO
 
Doc. Word : Islam
Doc. Word : Islam Doc. Word : Islam
Doc. Word : Islam
mejiavillamil23
 
Inocencio meléndez julio. contratación y gestión. la segmentación del me...
Inocencio meléndez julio. contratación y gestión.  la segmentación del me...Inocencio meléndez julio. contratación y gestión.  la segmentación del me...
Inocencio meléndez julio. contratación y gestión. la segmentación del me...
INOCENCIO MELÉNDEZ JULIO
 

Viewers also liked (20)

Grand Canyon in Less than 100 Photos
Grand Canyon in Less than 100 PhotosGrand Canyon in Less than 100 Photos
Grand Canyon in Less than 100 Photos
 
Tecnologias para la educación
Tecnologias para la educaciónTecnologias para la educación
Tecnologias para la educación
 
El problema de la setmana andrea
El problema de la setmana andreaEl problema de la setmana andrea
El problema de la setmana andrea
 
Universidad tecnologica equinoccial solis villalta doris remache bunci manu...
Universidad tecnologica equinoccial  solis villalta doris  remache bunci manu...Universidad tecnologica equinoccial  solis villalta doris  remache bunci manu...
Universidad tecnologica equinoccial solis villalta doris remache bunci manu...
 
Centrifuge 2014
Centrifuge 2014Centrifuge 2014
Centrifuge 2014
 
Prueba
PruebaPrueba
Prueba
 
Matt hunter
Matt hunterMatt hunter
Matt hunter
 
Presentación del sistema genesis y portal institucional j a
Presentación del sistema genesis y portal institucional j aPresentación del sistema genesis y portal institucional j a
Presentación del sistema genesis y portal institucional j a
 
Chuyen de ban_chinh
Chuyen de ban_chinhChuyen de ban_chinh
Chuyen de ban_chinh
 
Novas Tecnologias
Novas TecnologiasNovas Tecnologias
Novas Tecnologias
 
OTS-US Staffing Services
OTS-US Staffing ServicesOTS-US Staffing Services
OTS-US Staffing Services
 
Tout ce que le getting started MongoDB ne vous dira pas
Tout ce que le getting started MongoDB ne vous dira pasTout ce que le getting started MongoDB ne vous dira pas
Tout ce que le getting started MongoDB ne vous dira pas
 
Biochemistry sample
Biochemistry sampleBiochemistry sample
Biochemistry sample
 
Tecnologia 3 d
Tecnologia 3 dTecnologia 3 d
Tecnologia 3 d
 
4 mathematic03
4 mathematic034 mathematic03
4 mathematic03
 
Drag Reduction in Commercial Vehicles: Major Project
Drag Reduction in Commercial Vehicles: Major ProjectDrag Reduction in Commercial Vehicles: Major Project
Drag Reduction in Commercial Vehicles: Major Project
 
WBA Power Point Ready3
WBA Power Point Ready3WBA Power Point Ready3
WBA Power Point Ready3
 
Inocencio meléndez julio. la contabilidad como herramienta de la administra...
 Inocencio meléndez julio. la contabilidad como herramienta de la administra... Inocencio meléndez julio. la contabilidad como herramienta de la administra...
Inocencio meléndez julio. la contabilidad como herramienta de la administra...
 
Doc. Word : Islam
Doc. Word : Islam Doc. Word : Islam
Doc. Word : Islam
 
Inocencio meléndez julio. contratación y gestión. la segmentación del me...
Inocencio meléndez julio. contratación y gestión.  la segmentación del me...Inocencio meléndez julio. contratación y gestión.  la segmentación del me...
Inocencio meléndez julio. contratación y gestión. la segmentación del me...
 

Similar to MongoDB NoSQL - Developer Guide

Node Js, AngularJs and Express Js Tutorial
Node Js, AngularJs and Express Js TutorialNode Js, AngularJs and Express Js Tutorial
Node Js, AngularJs and Express Js Tutorial
PHP Support
 
MongoDB DOC v1.5
MongoDB DOC v1.5MongoDB DOC v1.5
MongoDB DOC v1.5
Tharun Srinivasa
 
SQL vs NoSQL, an experiment with MongoDB
SQL vs NoSQL, an experiment with MongoDBSQL vs NoSQL, an experiment with MongoDB
SQL vs NoSQL, an experiment with MongoDB
Marco Segato
 
Everything You Need to Know About MongoDB Development.pptx
Everything You Need to Know About MongoDB Development.pptxEverything You Need to Know About MongoDB Development.pptx
Everything You Need to Know About MongoDB Development.pptx
75waytechnologies
 
Pros and Cons of MongoDB in Web Development
Pros and Cons of MongoDB in Web DevelopmentPros and Cons of MongoDB in Web Development
Pros and Cons of MongoDB in Web Development
Nirvana Canada
 
Mongo db
Mongo dbMongo db
Mongo db
Gyanendra Yadav
 
how_can_businesses_address_storage_issues_using_mongodb.pptx
how_can_businesses_address_storage_issues_using_mongodb.pptxhow_can_businesses_address_storage_issues_using_mongodb.pptx
how_can_businesses_address_storage_issues_using_mongodb.pptx
sarah david
 
how_can_businesses_address_storage_issues_using_mongodb.pdf
how_can_businesses_address_storage_issues_using_mongodb.pdfhow_can_businesses_address_storage_issues_using_mongodb.pdf
how_can_businesses_address_storage_issues_using_mongodb.pdf
sarah david
 
MongoDB
MongoDBMongoDB
MongoDB
wiTTyMinds1
 
Introduction to MongoDB and its best practices
Introduction to MongoDB and its best practicesIntroduction to MongoDB and its best practices
Introduction to MongoDB and its best practices
AshishRathore72
 
nodejs.pptx
nodejs.pptxnodejs.pptx
nodejs.pptx
shamsullah shamsi
 
Mongodb
MongodbMongodb
Mongodb
Apurva Vyas
 
What are the major components of MongoDB and the major tools used in it.docx
What are the major components of MongoDB and the major tools used in it.docxWhat are the major components of MongoDB and the major tools used in it.docx
What are the major components of MongoDB and the major tools used in it.docx
Technogeeks
 
Mongo db transcript
Mongo db transcriptMongo db transcript
Mongo db transcript
foliba
 
Mongo db dhruba
Mongo db dhrubaMongo db dhruba
Mongo db dhruba
Dhrubaji Mandal ♛
 
Introduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDBIntroduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDB
Ahmed Farag
 
MongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql DatabaseMongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql Database
Sudhir Patil
 
MongoDB NoSQL database a deep dive -MyWhitePaper
MongoDB  NoSQL database a deep dive -MyWhitePaperMongoDB  NoSQL database a deep dive -MyWhitePaper
MongoDB NoSQL database a deep dive -MyWhitePaper
Rajesh Kumar
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
balwinders
 
MongoDB.pptx
MongoDB.pptxMongoDB.pptx
MongoDB.pptx
Aayush Chimaniya
 

Similar to MongoDB NoSQL - Developer Guide (20)

Node Js, AngularJs and Express Js Tutorial
Node Js, AngularJs and Express Js TutorialNode Js, AngularJs and Express Js Tutorial
Node Js, AngularJs and Express Js Tutorial
 
MongoDB DOC v1.5
MongoDB DOC v1.5MongoDB DOC v1.5
MongoDB DOC v1.5
 
SQL vs NoSQL, an experiment with MongoDB
SQL vs NoSQL, an experiment with MongoDBSQL vs NoSQL, an experiment with MongoDB
SQL vs NoSQL, an experiment with MongoDB
 
Everything You Need to Know About MongoDB Development.pptx
Everything You Need to Know About MongoDB Development.pptxEverything You Need to Know About MongoDB Development.pptx
Everything You Need to Know About MongoDB Development.pptx
 
Pros and Cons of MongoDB in Web Development
Pros and Cons of MongoDB in Web DevelopmentPros and Cons of MongoDB in Web Development
Pros and Cons of MongoDB in Web Development
 
Mongo db
Mongo dbMongo db
Mongo db
 
how_can_businesses_address_storage_issues_using_mongodb.pptx
how_can_businesses_address_storage_issues_using_mongodb.pptxhow_can_businesses_address_storage_issues_using_mongodb.pptx
how_can_businesses_address_storage_issues_using_mongodb.pptx
 
how_can_businesses_address_storage_issues_using_mongodb.pdf
how_can_businesses_address_storage_issues_using_mongodb.pdfhow_can_businesses_address_storage_issues_using_mongodb.pdf
how_can_businesses_address_storage_issues_using_mongodb.pdf
 
MongoDB
MongoDBMongoDB
MongoDB
 
Introduction to MongoDB and its best practices
Introduction to MongoDB and its best practicesIntroduction to MongoDB and its best practices
Introduction to MongoDB and its best practices
 
nodejs.pptx
nodejs.pptxnodejs.pptx
nodejs.pptx
 
Mongodb
MongodbMongodb
Mongodb
 
What are the major components of MongoDB and the major tools used in it.docx
What are the major components of MongoDB and the major tools used in it.docxWhat are the major components of MongoDB and the major tools used in it.docx
What are the major components of MongoDB and the major tools used in it.docx
 
Mongo db transcript
Mongo db transcriptMongo db transcript
Mongo db transcript
 
Mongo db dhruba
Mongo db dhrubaMongo db dhruba
Mongo db dhruba
 
Introduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDBIntroduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDB
 
MongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql DatabaseMongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql Database
 
MongoDB NoSQL database a deep dive -MyWhitePaper
MongoDB  NoSQL database a deep dive -MyWhitePaperMongoDB  NoSQL database a deep dive -MyWhitePaper
MongoDB NoSQL database a deep dive -MyWhitePaper
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
 
MongoDB.pptx
MongoDB.pptxMongoDB.pptx
MongoDB.pptx
 

Recently uploaded

Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 

Recently uploaded (20)

Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 

MongoDB NoSQL - Developer Guide

  • 1. prepared for: 20/20 Companies | 8.22.2010 NoSQL - MongoDB version 1.0 Presenter: Shiv K Sah Department: OST Designation: Technical Lead
  • 2. prepared for: 20/20 Companies | 8.22.2010 Agenda ❖ NoSQL Introduction & Overview ❖ MongoDB Introduction & Overview ❖ Why MongoDB ❖ Relationship of RDBMS terminology with MongoDB ❖ Installing server and tools ❖ The Mongo Shell ❖ CRUD (Creating, Reading and Updating Data) ❖ Aggregation Framework ❖ Schema Design - Patterns ❖ Replication ❖ Sharding ❖ Use case studies of Analytic Application'
  • 3. prepared for: 20/20 Companies | 8.22.2010 NoSQL : “Not Only SQL”
  • 4. prepared for: 20/20 Companies | 8.22.2010 NoSQL Introduction ● NoSQL database, also called Not Only SQL, is an approach to data management and database design that's useful for very large sets of distributed data. ● A NoSQL database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in traditional relational databases. ● NoSQL (not only SQL) - a number of approaches and projects aimed for the implementation of database models, with significant differences from those that used in traditional relational database management system with access to the data with the help of SQL. Description schema in the case of NoSQL can be carried out through the use of different data structures: hash tables, arrays, trees, etc. ● For the first time the term "NoSQL" was used in the late 90's. ● Now there are about 150 kinds of NoSQL databases (nosql-database.org)
  • 5. prepared for: 20/20 Companies | 8.22.2010 NoSQL Overview
  • 6. prepared for: 20/20 Companies | 8.22.2010 Types of NoSQL databases ● Key-Value databases: CouchDB, Oracle NoSQL Database, MemcacheDB, DynamoDB(Amazon), FoundationDB, HyperDex, Redis, Riak, OrientDB, FairCom c-treeACE, Aerospike, MUMPS ● Document databases: MongoDB, Apache CouchDB, Couchbase, HyperDex, MarkLogic, Lotus Notes, Clusterpoint, OrientDB, Qizx ● Column-family databases: Accumulo, Cassandra, Druid, HBase, Vertica ● Graph databases: Allegro, Neo4J, InfiniteGraph, OrientDB, Virtuoso, Stardog ● Multi-model: OrientDB, FoundationDB, ArangoDB, Alchemy Database, CortexDB ● Migrations, Polyglot persistence and more
  • 7. prepared for: 20/20 Companies | 8.22.2010
  • 8. prepared for: 20/20 Companies | 8.22.2010 Types of NoSQL databases
  • 9. prepared for: 20/20 Companies | 8.22.2010 Advantage of using NoSQL ● Quicker development times, this is due to aggregates, meaning you write to the database once, instead of multiple times for individual entities. ● Easy to scale where relational databases are meant for a single server. ● Prevents having to create tables with custom columns like custom1, custom2, etc. This is due to all NoSQL databases being schema-less ● Prevents having tables with large amounts of NULL values (sparse table). ● It’s More Scalable ● It’s Flexible ● It’s Administrator-Friendly ● It’s Cost-Effective and Open-Source ● The Cloud’s the Limit
  • 10. prepared for: 20/20 Companies | 8.22.2010 Disadvantages of using NoSQL ● It Has a Very Narrow Focus ● Standardization and Open Source ● Performance and Scaling > Consistency ● A General Lack of Maturity ● It Doesn’t Play Nice with Analytics ● No relations between the tables(collections in mongodb). ● No Stored Procedures in mongodb (NoSql database). ● Most of the administration is depends upon scripting like bash,perl etc., in linux environment. ● GUI mode tools to access the database is not flexibly available in market.
  • 11. prepared for: 20/20 Companies | 8.22.2010 MongoDB (from humongous)
  • 12. prepared for: 20/20 Companies | 8.22.2010 ● It is a Open Source, cross platform database written in C++. ● It is a document oriented database that provides, high performance, high availability, and easy scalability. ● It stores data as documents. So it is a document oriented database. ● It does not support SQL It supports a rich, ad-hoc query language of its own. ● It works on concept of collection and document. There are few organizations migrated to MongoDb and it proven benefits to them:. These are: What is a MongoDB? Organization Migrated From Application MTV Networks Multiple RDBMS Centralized content management Cisco Multiple RDBMS Analytics, social networking Foursquare PostgreSQL Social, mobile networking platforms Salesforce marketing Cloud RDBMS Social marketing, analytics Orange Digital MySQL Content management edmunds.com Oracale Billing, online advertising, user data
  • 13. prepared for: 20/20 Companies | 8.22.2010 Basic Overview 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. Collections do not enforce a schema. Documents within a collection can have different fields. Document: A document is a set of key-value pairs. 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.
  • 14. prepared for: 20/20 Companies | 8.22.2010 ● Schema less : MongoDB is document database in which one collection holds different different documents. Number of fields, content and size of the document can be differ from one document to another. ● You can set an index on any attribute of a MongoDb record (as FirstName="Sameer",Address="8 Gandhi Road"), with respect to which, a record can be sort quickly and ordered. ● MongoDb supports various programming languages like C, C# and .NET, C++, Erlang, Haskell, Java, Javascript, Perl, PHP, Python, Ruby, Scala (via Casbah). ● MongoDb supports rich query to fetch the data. ● Data is stored in the form of JSON style documents. ● No complex joins ● MongoDb is easily installable. Why MongoDB?
  • 15. prepared for: 20/20 Companies | 8.22.2010 Features ● Document-oriented ● Ad hoc queries ● Indexing ● Replication ● Load balancing ● File storage ● Aggregation ● Server-side JavaScript execution ● Capped collections ● HTTP Server for REST API
  • 16. prepared for: 20/20 Companies | 8.22.2010 How mongoDB works? There is a process “mongod” that acts as a database server. This process attaches itself to a directory with the --dbpath option. (Default dbpath : “/data/db”). And start listening to a specific port number via --port option. (Default port : 27017, 28017 - Http interfaces) Example:- > .mongod.exe --dbpath "C:datadb" --port 28080
  • 17. prepared for: 20/20 Companies | 8.22.2010 ➢ JSON:- JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. Its built on key value structure and ordered list of values. ➢ BSON:- Binary JSON, is a binary-encoded serialization of JSON-like docu- ments. It supports the embedding of documents and arrays within other doc- uments and arrays. BSON also contains extensions that allow representa- tion of data types that are not part of the JSON spec. Characteristics:- ○ Lightweight: minimum overhead ○ Traversable ○ Efficient: encoding and decoding Behind MongoDB - JSON / BSON
  • 18. prepared for: 20/20 Companies | 8.22.2010 Behind MongoDB - JSON / BSON
  • 19. prepared for: 20/20 Companies | 8.22.2010 MongoDB : Engine ➢ MMAP: For heavy read application ➢ WiredTiger: For heavy write applications.
  • 20. prepared for: 20/20 Companies | 8.22.2010 MongoDB : Tools ➢ MongoDB Cloud Manager ➢ Robomongo ➢ MongoVUE ➢ MongoChef ➢ NoSQL Manager for MongoDB ➢ PHPMoAdmin ➢ PHPmongoDB ➢ mongobird ➢ Mongo Management Studio ➢ 3T MongoChef ➢ 3T Schema Explorer ➢ 3T Data Compare
  • 21. prepared for: 20/20 Companies | 8.22.2010 Sample MongoDB Document Below given example shows the document structure of a blog site which is simply a comma separated key value pair. { _id: ObjectId(7df78ad8902c) title: 'MongoDB Overview', description: 'MongoDB is no sql database', by: 'tutorials point', url: 'http://www.tutorialspoint.com', tags: ['mongodb', 'database', 'NoSQL'], likes: 100, comments: [ { user:'user1', message: 'My first comment', dateCreated: new Date(2011,1,20,2,15), like: 0 }, { user:'user2', message: 'My second comments', dateCreated: new Date(2011,1,25,7,45), like: 5 } ] } Note: _id is a 12 bytes hexadecimal number which assures the uniqueness of every document. You can provide _id while inserting the document. If you didn't provide then MongoDB provide a unique id for every document. These 12 bytes first 4 bytes for the current timestamp, next 3 bytes for machine id, next 2 bytes for process id of mongodb server and remaining 3 bytes are simple incremental value.
  • 22. prepared for: 20/20 Companies | 8.22.2010 Relationship of RDBMS terminology with MongoDB Below given table shows the relationship of RDBMS terminology with MongoDB 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) Database Server and Client Mysqld/Oracle mongod mysql/sqlplus mongo
  • 23. prepared for: 20/20 Companies | 8.22.2010 ➢ Download mongoDB from https://mongodb.org/downloads ➢ Install mongoDB (Manual: http://docs.mongodb.org/manual/installation) ➢ Configuration: ○ dbpath - /var/lib/mongo, /data/db ○ log path - /var/log/mongodb ○ Configuration file - /etc/mongod.conf, C:/mongodb/mongod.cfg ○ port - 27017, 28017 ➢ Install mongod service MongoDB Installation
  • 24. prepared for: 20/20 Companies | 8.22.2010 ➢ Authentication - Who are you in MongoDB? ○ Application user ○ Administrator ○ Backup job ○ Monitoring agents ➢ Authorization - What can you do in MongoDB? ○ CDUD Operation ○ Configure the database ○ Manage sharding/replication ○ User management MongoDB Configuration
  • 25. prepared for: 20/20 Companies | 8.22.2010 Manage User and Roles ➢ MongoDB employs Role-Based Access Control (RBAC) to determine access for users ➢ MongoDb store user and roles details to admin database. ➢ Each application and user of a MongoDB system should map to a distinct application or administrator ➢ MongoDB provide built-in roles like… ○ Database user role ■ read ■ readWrite ○ Database Administration Roles ■ dbAdmin ■ dbOwner ■ userAdmin
  • 26. prepared for: 20/20 Companies | 8.22.2010 Create a system user administrator use admin db.createUser({ user: "root", pwd: "root", roles: ["root"] }) db.createUser({ user: "siteUserAdmin", pwd: "password", roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] })
  • 27. prepared for: 20/20 Companies | 8.22.2010 MongoDB : CRUD Example ➢ Create database “icreondb” ➢ Create collection >use icreondb switched to db icreondb >db.createCollection("departments") { "ok" : 1 } >db.departments.insert( { "name": "Open Source Technology", "code": "OST", "technology": ["PHP", "Python", "MySQL", "MongoDB"] } )
  • 28. prepared for: 20/20 Companies | 8.22.2010 Collection : Insert document
  • 29. prepared for: 20/20 Companies | 8.22.2010 Collection : Update document
  • 30. prepared for: 20/20 Companies | 8.22.2010 Collection : Delete document The following diagram shows the same query in SQL:
  • 31. prepared for: 20/20 Companies | 8.22.2010 Collection : Find in collections
  • 32. prepared for: 20/20 Companies | 8.22.2010 Collection : Find in collections
  • 33. prepared for: 20/20 Companies | 8.22.2010 Collection : Filter Query Comparison Operators $eq Matches values that are equal to a specified value. $gt Matches values that are greater than a specified value. $gte Matches values that are greater than or equal to a specified value. $lt Matches values that are less than a specified value. $lte Matches values that are less than or equal to a specified value. $ne Matches all values that are not equal to a specified value. $in Matches any of the values specified in an array. $nin Matches none of the values specified in an array.
  • 34. prepared for: 20/20 Companies | 8.22.2010 Collection : Filter Query Logical Operators $or Joins query clauses with a logical OR returns all documents that match the conditions of either clause. $and Joins query clauses with a logical AND returns all documents that match the conditions of both clauses. $not Inverts the effect of a query expression and returns documents that do not match the query expression. $nor Joins query clauses with a logical NOR returns all documents that fail to match both clauses.
  • 35. prepared for: 20/20 Companies | 8.22.2010 Collection : Filter Query $exists Matches documents that have the specified field. $type Selects documents if a field is of the specified type. Element Operators Array Operators $all Matches arrays that contain all elements specified in the query. $elemMatch Selects documents if element in the array field matches all the specified $elemMatch conditions $size Selects documents if the array field is a specified size.
  • 36. prepared for: 20/20 Companies | 8.22.2010 Collection : Projection Projection Operators $ Projects the first element in an array that matches the query condition. $elemMatch Projects the first element in an array that matches the specified $elemMatch condition. $meta Projects the document’s score assigned during $text operation. $slice Limits the number of elements projected from an array. Supports skip and limit slices.
  • 37. prepared for: 20/20 Companies | 8.22.2010 Aggregation Framework ➢ Aggregations are operations that process data records and return computed results. ➢ MongoDB provides a rich set of aggregation operations that examine and perform calculations on the data sets. ➢ Running data aggregation on the mongod instance simplifies application code and limits resource requirements.
  • 38. prepared for: 20/20 Companies | 8.22.2010 Aggregation Framework
  • 39. prepared for: 20/20 Companies | 8.22.2010 Aggregation : Pipeline Operator Name Description $match Filter documents $project Reshape document $group Summarize document $unwind Expand document $sort Order document $limit/$skip Pagination document $redant Restrict document $geoNear Proximity sort document
  • 40. prepared for: 20/20 Companies | 8.22.2010 Zip document { "_id": "10280", "city": "NEW YORK", "state": "NY", "pop": 5574, "loc": [ -74.016323, 40.710537 ] } Report: ➢ States with Populations above 10 Million ➢ Average City Population by State ➢ Largest and Smallest Cities by State Aggregation : Demo
  • 41. prepared for: 20/20 Companies | 8.22.2010 SQL and the corresponding MongoDB statements Statement MYSQL MONGODB Create CREATE TABLE users ( id INT NOT NULL AUTO_INCREMENT, user_id Varchar(30), age Number, status char(1), PRIMARY KEY (id) ) db.users.insert( { user_id: "abc123", age: 55, status: "A" } ) OR db.createCollection("users") Alter ALTER TABLE users ADD join_date DATETIME db.users.update( { }, { $set: { join_date: new Date() } }, { multi: true } ) Drop Column ALTER TABLE users DROP COLUMN join_date db.users.update( { }, { $unset: { join_date: "" } }, { multi: true } ) Drop Table DROP TABLE users db.users.drop() Insert INSERT INTO users(user_id, age, status) VALUES ("bcd001", 45, "A") db.users.insert( { user_id: "bcd001", age: 45, status: "A" } ) Select SELECT user_id, status FROM users WHERE status = "A" db.users.find( { status: "A" }, { user_id: 1, status: 1, _id: 0 } ) () Update UPDATE users SET status = "C" WHERE age > 25 db.users.update( { age: { $gt: 25 } }, { $set: { status: "C" } }, { multi: true } ) Delete DELETE FROM users WHERE status = "D" db.users.remove( { status: "D" } )
  • 42. prepared for: 20/20 Companies | 8.22.2010 ➢ What is a priority? ○ High consistency ○ High read performance ○ High write performance ➢ How does the application access and manipulate data? ○ Read/Write Ratio ○ Types of Queries / Updates ○ Data life-cycle and growth ○ Analytics (MapReduce, Aggregation) Schema Design - Patterns
  • 43. prepared for: 20/20 Companies | 8.22.2010 ➢ One to One Relationship ○ Relationships are often embedded ○ Optimized read performance. ○ Document provides a holistic representation of objects with embedded entities ➢ One to Many Relations ○ De-normalization ○ Provides data locality using Referencing or Embedding ➢ Many to Many Relations ○ Referencing and indexing Schema Design - Example
  • 44. prepared for: 20/20 Companies | 8.22.2010 Example: Blogging in MySQL* - MongoDB
  • 45. prepared for: 20/20 Companies | 8.22.2010 Data Modeling in MongoDB There are two tools that allow applications to represent these relationships: references and embedded documents. References: References: References store the relationships between data by including links or references from one document to another. Applications can resolve these references to access the related data. Embedded Data: Embedded documents capture relationships between data by storing related data in a single document structure. These denormalized data models allow applications to retrieve and manipulate related data in a single database operation. User Document: { _id: <ObjectId1>, username: "user1" } Contact Document: { _id: <ObjectId2>, user_id: <ObjectId1>, phone: "1234567890", email: "user@example.com" } Access Document: { _id: <ObjectId3>, user_id: <ObjectId1>, level: 5, group: "Dev" } { _id: <ObjectId1>, username: "user1", contact: { phone: "1234567890", email: "user@example.com" }, access: { level: 5, group: "Dev" } }
  • 46. prepared for: 20/20 Companies | 8.22.2010 Replication ➢ A replica set in MongoDB is a group of mongod processes that maintain the same data set ➢ Replica sets provide redundancy and high availability, and are the basis for all production deployments
  • 47. prepared for: 20/20 Companies | 8.22.2010 Sharding ➢ Sharding is the process of storing data records across multiple machines and is MongoDB’s approach to meeting the demands of data growth. ➢ With sharding, you add more machines to support data growth and the demands of read and write operations.
  • 48. prepared for: 20/20 Companies | 8.22.2010 Database Design?
  • 49. prepared for: 20/20 Companies | 8.22.2010 Further studies ➢ https://university.mongodb.com ➢ https://docs.mongodb.org/manual ➢ https://www.mongodb.com/presentations
  • 50. prepared for: 20/20 Companies | 8.22.2010 Shiv Kumar Sah Technical Lead TechExpert@me.com @shivkumarsah Thank You ➢ Q & A ➢ Feedback