SlideShare ist ein Scribd-Unternehmen logo
1 von 50
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

Weitere ähnliche Inhalte

Was ist angesagt?

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 dataJimmy Ray
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB Habilelabs
 
MongoDB presentation
MongoDB presentationMongoDB presentation
MongoDB presentationHyphen Call
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBMike Dirolf
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDBCĂŠsar Trigo
 
MongoDB: An Introduction - june-2011
MongoDB:  An Introduction - june-2011MongoDB:  An Introduction - june-2011
MongoDB: An Introduction - june-2011Chris Westin
 
Mongo db workshop # 02
Mongo db workshop # 02Mongo db workshop # 02
Mongo db workshop # 02FarhatParveen10
 
Mongodb intro
Mongodb introMongodb intro
Mongodb introchristkv
 
Building Spring Data with MongoDB
Building Spring Data with MongoDBBuilding Spring Data with MongoDB
Building Spring Data with MongoDBMongoDB
 
MongodB Internals
MongodB InternalsMongodB Internals
MongodB InternalsNorberto Leite
 
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 tutorialsSpringPeople
 

Was ist angesagt? (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
 

Andere mochten auch

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 PhotosRyn Gargulinski
 
Tecnologias para la educaciĂłn
Tecnologias para la educaciĂłnTecnologias para la educaciĂłn
Tecnologias para la educaciĂłnIarozeth 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 2014kels_147
 
Prueba
PruebaPrueba
Pruebaberzabeth
 
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 afelipegomezg
 
Novas Tecnologias
Novas TecnologiasNovas Tecnologias
Novas TecnologiasLigimaca
 
OTS-US Staffing Services
OTS-US Staffing ServicesOTS-US Staffing Services
OTS-US Staffing ServicesShweta 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 pasBruno Bonnin
 
Tecnologia 3 d
Tecnologia 3 dTecnologia 3 d
Tecnologia 3 dAron Sporkens
 
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 ProjectJJ Technical Solutions
 
WBA Power Point Ready3
WBA Power Point Ready3WBA Power Point Ready3
WBA Power Point Ready3asiwebdesigners
 
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
 

Andere mochten auch (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...
 

Ähnlich wie 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 TutorialPHP Support
 
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 MongoDBMarco 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.pptx75waytechnologies
 
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 DevelopmentNirvana Canada
 
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.pptxsarah 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.pdfsarah david
 
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 practicesAshishRathore72
 
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.docxTechnogeeks
 
Mongo db transcript
Mongo db transcriptMongo db transcript
Mongo db transcriptfoliba
 
Introduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDBIntroduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDBAhmed Farag
 
MongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql DatabaseMongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql DatabaseSudhir 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 -MyWhitePaperRajesh Kumar
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQLbalwinders
 

Ähnlich wie 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
 

KĂźrzlich hochgeladen

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vĂĄzquez
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 

KĂźrzlich hochgeladen (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

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