SlideShare uma empresa Scribd logo
1 de 27
Web Data Management, Search and Retrieval Course (MCOM7348)
University of Birzeit, Palestine
January, 2014

Synthesis Paper Talk

Nosql Database
Fayez shayeb

bbbbb

Master of Computing, Birzeit University
Fayez.aauj@hotmail.com

Master of Computing, Birzeit University
bbbbbbb@yahoo.com

This is a student talk, at the Web Data Management, Search and Retrieval
Course, each student is is asked to present his/her synthesis paper.
Course Page: http://jarrar-courses.blogspot.com/2013/11/web-data-management.html
1
Document-oriented database
• document-oriented database is a computer
program designed for storing, retrieving, and
managing document-oriented, or semi structured
data, information
Comparison
 Document db

 Relational
Article
- id
- authorid
- title
- content

Author
- id
- name
- email

Comment
- id
- articleid
- message

Article
- _id
- title
- content
- author
- _id
- name
- email
- comments[]
Concepts
 Joins
 No joins
 Joins at "design time", not at "query time“
 Due to embedded docs and arrays less joins are needed

 Constraints
 No foreign key constraints
 Unique indexes

 Transactions
 No commit/rollback
 Atomic operations
 Multiple actions inside the same document
 Incl. embedded documents
Benefits

 Scalable: good for a lot of data / traffic
 Horizontal scaling: to more nodes
 Good for web-apps

 Performance
 No joins and constraints

 Dev/user friendly
 Data is modeled to how the app is going to use it
 No conversion between object oriented > relational
 No static schema = agile
One-to-many
 Embedded array / array keys
 Some queries get harder
 You can index arrays!

 Normalized approach
 More flexibility
 A lot less performance

Article
- _id
- content
- tags: {“foo”, “bar”}
- comments: {“id1”, “id2”}
many-to-many
 Using array keys
 No join table
 References on both sides
Article
- _id
- content
- category_ids : {“id1”, “id2”}

Category
- _id
- name
- article_ids: {“id7”, “id8”}

 Advantage: simple queries
articles.Where(p => p.CategoryIds.Contains(categoryId))
categories.Where(c => c.ArticleIds.Contains(articleId))

 Disadvantage: duplication, update two docs
json

•
•
•

Stands for Javascript Object Notation
Derived from Javascript scripting language
Used for representing simple data
structures and associative arrays

{

{
"_id": "BCCD12CBB",
"type": "person",
"name": "Darth Vader",
"age": 63,
"headware":
["Helmet", "Sombrero"],
"dark_side": true

}

"_id": "BCCD12CBC",
"type": "person",
"name": "Luke",
"age": 35,
"powers":
["Pull", "Jedi Mind Trick"],
"dark_side": false
}
Replication
 Only one server is active for writes (the primary, or

master) at a given time – this is to allow strong
consistent (atomic) operations. One can optionally
send read operations to the secondaries when
eventual consistency semantics are acceptable.
Sharding
 Sharding is the partitioning of data among multiple

machines in an order-preserving manner.(horizontal
scaling )
Machine 1

Machine 2

Machine 3

Alabama → Arizona

Colorado → Florida

Arkansas → California

Indiana → Kansas

Idaho → Illinois

Georgia → Hawaii

Maryland → Michigan

Kentucky → Maine

Minnesota → Missouri

Montana → Montana

Nebraska → New Jersey

Ohio → Pennsylvania

New Mexico → North Dakota

Rhode Island → South Dakota

Tennessee → Utah

Vermont → West Virgina

Wisconsin → Wyoming
Sharding
 The set of servers/mongod process within the shard

comprise a replica set
Replication & Sharding conclusion
 sharding is the tool for scaling a system, and

replication is the tool for data safety, high availability,
and disaster recovery. The two work in tandem yet are
orthogonal concepts in the design.
Document Databases
What is MongoDB?
 Creator: 10 gen, former doublick
 Name: short for humongous (
 Language: C++

)
What is MongoDB?
 Defination: MongoDB is an open source, document-

oriented database designed with both scalability and
developer agility in mind. Instead of storing your data
in tables and rows as you would with a relational
database, in MongoDB you store JSON-like
documents with dynamic schemas(schemafree, schemaless).
What is MongoDB?
 Goal: bridge the gap between key-value stores (which

are fast and scalable) and relational databases (which
have rich functionality).
MongoDB terms ?
Term mapping
MongoDB Data model
 Data model: Using BSON (binary JSON), developers

can easily map to modern object-oriented languages
without a complicated ORM layer.
 BSON is a binary format in which zero or more
key/value pairs are stored as a single entity.
 lightweight, traversable, efficient
Schema design
 RDBMS: join
Schema design
Schema design
Query MongoDB Vs sql?
SQL

mongodb

Create table

db.CreateCollection()

Insert into

db.coll.save()

select

db.coll.find()

update

db.coll.update

delete

db.coll.remove()

drop

db.coll.drop()
Query MongoDB Vs sql?
Query MongoDB Vs sql?
API for MongoDB :
C
C++
C#
Erlang
Haskell
Java
node.js

PHP
Perl
Python
Ruby
Scala (Casbah)
Thank You

27

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

MongoDB: An Introduction - june-2011
MongoDB:  An Introduction - june-2011MongoDB:  An Introduction - june-2011
MongoDB: An Introduction - june-2011
 
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
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
 
MongoDB NoSQL - Developer Guide
MongoDB NoSQL - Developer GuideMongoDB NoSQL - Developer Guide
MongoDB NoSQL - Developer Guide
 
MongoDB Schema Design by Examples
MongoDB Schema Design by ExamplesMongoDB Schema Design by Examples
MongoDB Schema Design by Examples
 
MongoDB presentation
MongoDB presentationMongoDB presentation
MongoDB presentation
 
Mongodb
MongodbMongodb
Mongodb
 
MongodB Internals
MongodB InternalsMongodB Internals
MongodB Internals
 
Mongo db report
Mongo db reportMongo db report
Mongo db report
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
 
MongoDB by Emroz sardar.
MongoDB by Emroz sardar.MongoDB by Emroz sardar.
MongoDB by Emroz sardar.
 
Mongodb tutorial at Easylearning Guru
Mongodb tutorial  at Easylearning GuruMongodb tutorial  at Easylearning Guru
Mongodb tutorial at Easylearning Guru
 
A Study on Mongodb Database
A Study on Mongodb DatabaseA Study on Mongodb Database
A Study on Mongodb Database
 
Mongo DB: Operational Big Data Database
Mongo DB: Operational Big Data DatabaseMongo DB: Operational Big Data Database
Mongo DB: Operational Big Data Database
 
Mongo DB
Mongo DBMongo DB
Mongo DB
 
Introduction to mongodb
Introduction to mongodbIntroduction to mongodb
Introduction to mongodb
 
Object oriented databases
Object oriented databasesObject oriented databases
Object oriented databases
 
SURVEY ON MONGODB: AN OPEN-SOURCE DOCUMENT DATABASE
SURVEY ON MONGODB: AN OPEN-SOURCE DOCUMENT DATABASESURVEY ON MONGODB: AN OPEN-SOURCE DOCUMENT DATABASE
SURVEY ON MONGODB: AN OPEN-SOURCE DOCUMENT DATABASE
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
introduction to NOSQL Database
introduction to NOSQL Databaseintroduction to NOSQL Database
introduction to NOSQL Database
 

Destaque

February Corporate Presentation 2014
February Corporate Presentation 2014February Corporate Presentation 2014
February Corporate Presentation 2014
oncolyticsinc
 
Satélites artificiais
Satélites artificiaisSatélites artificiais
Satélites artificiais
nondoufeito
 
Preparation and contest
Preparation and contestPreparation and contest
Preparation and contest
msukms
 

Destaque (20)

MapReduce and Hadoop
MapReduce and HadoopMapReduce and Hadoop
MapReduce and Hadoop
 
Visiting card
Visiting cardVisiting card
Visiting card
 
February Corporate Presentation 2014
February Corporate Presentation 2014February Corporate Presentation 2014
February Corporate Presentation 2014
 
たのしいかめらのえらびかた~デジタル一眼編
たのしいかめらのえらびかた~デジタル一眼編たのしいかめらのえらびかた~デジタル一眼編
たのしいかめらのえらびかた~デジタル一眼編
 
Ano 2013 retrospctiva
Ano 2013 retrospctivaAno 2013 retrospctiva
Ano 2013 retrospctiva
 
Chamomiletea metroblog com_the_benefits_of_chamomile_tea
Chamomiletea metroblog com_the_benefits_of_chamomile_teaChamomiletea metroblog com_the_benefits_of_chamomile_tea
Chamomiletea metroblog com_the_benefits_of_chamomile_tea
 
Quick Finance for Defaulters
Quick Finance for DefaultersQuick Finance for Defaulters
Quick Finance for Defaulters
 
Montes de Toledo
Montes de ToledoMontes de Toledo
Montes de Toledo
 
SM_PPT_Example
SM_PPT_ExampleSM_PPT_Example
SM_PPT_Example
 
Satélites artificiais
Satélites artificiaisSatélites artificiais
Satélites artificiais
 
Cantabrian mountains
Cantabrian mountains Cantabrian mountains
Cantabrian mountains
 
Preparation and contest
Preparation and contestPreparation and contest
Preparation and contest
 
Cadde spot site
Cadde spot siteCadde spot site
Cadde spot site
 
Basque mountain
Basque mountain Basque mountain
Basque mountain
 
GelecekHane Ticaret 2.0 - Mark Holenstein Sap
GelecekHane Ticaret 2.0 - Mark Holenstein SapGelecekHane Ticaret 2.0 - Mark Holenstein Sap
GelecekHane Ticaret 2.0 - Mark Holenstein Sap
 
1 1
1 11 1
1 1
 
Evaluation for preliminary task
Evaluation for preliminary taskEvaluation for preliminary task
Evaluation for preliminary task
 
yOS tour de Montréal
yOS tour de MontréalyOS tour de Montréal
yOS tour de Montréal
 
ITFT - Famous wild life sancturies
ITFT - Famous wild life sancturiesITFT - Famous wild life sancturies
ITFT - Famous wild life sancturies
 
Iberian mountain
Iberian mountainIberian mountain
Iberian mountain
 

Semelhante a MongoDB

MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)
MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)
MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)
MongoDB
 

Semelhante a MongoDB (20)

Mongo db basics
Mongo db basicsMongo db basics
Mongo db basics
 
Copy of MongoDB .pptx
Copy of MongoDB .pptxCopy of MongoDB .pptx
Copy of MongoDB .pptx
 
Document databases
Document databasesDocument databases
Document databases
 
Mongo db
Mongo dbMongo db
Mongo db
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to 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
 
MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)
MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)
MongoDB Schema Design (Richard Kreuter's Mongo Berlin preso)
 
Managing Social Content with MongoDB
Managing Social Content with MongoDBManaging Social Content with MongoDB
Managing Social Content with MongoDB
 
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and SparkVital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
 
lecture_34e.pptx
lecture_34e.pptxlecture_34e.pptx
lecture_34e.pptx
 
Mongodb Training Tutorial in Bangalore
Mongodb Training Tutorial in BangaloreMongodb Training Tutorial in Bangalore
Mongodb Training Tutorial in Bangalore
 
3.Implementation with NOSQL databases Document Databases (Mongodb).pptx
3.Implementation with NOSQL databases Document Databases (Mongodb).pptx3.Implementation with NOSQL databases Document Databases (Mongodb).pptx
3.Implementation with NOSQL databases Document Databases (Mongodb).pptx
 
Introduction to MongoDB Basics from SQL to NoSQL
Introduction to MongoDB Basics from SQL to NoSQLIntroduction to MongoDB Basics from SQL to NoSQL
Introduction to MongoDB Basics from SQL to NoSQL
 
Techorama - Evolvable Application Development with MongoDB
Techorama  - Evolvable Application Development with MongoDBTechorama  - Evolvable Application Development with MongoDB
Techorama - Evolvable Application Development with MongoDB
 
Saran 01.06.2015
Saran 01.06.2015Saran 01.06.2015
Saran 01.06.2015
 
A Study on Mongodb Database.pdf
A Study on Mongodb Database.pdfA Study on Mongodb Database.pdf
A Study on Mongodb Database.pdf
 
Spring data presentation
Spring data presentationSpring data presentation
Spring data presentation
 
Building your first app with MongoDB
Building your first app with MongoDBBuilding your first app with MongoDB
Building your first app with MongoDB
 
Asp.net Programming Training (Web design, Web development)
Asp.net Programming Training (Web design, Web  development)Asp.net Programming Training (Web design, Web  development)
Asp.net Programming Training (Web design, Web development)
 
NOSQL and MongoDB Database
NOSQL and MongoDB DatabaseNOSQL and MongoDB Database
NOSQL and MongoDB Database
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

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...
 
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...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
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
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 

MongoDB

  • 1. Web Data Management, Search and Retrieval Course (MCOM7348) University of Birzeit, Palestine January, 2014 Synthesis Paper Talk Nosql Database Fayez shayeb bbbbb Master of Computing, Birzeit University Fayez.aauj@hotmail.com Master of Computing, Birzeit University bbbbbbb@yahoo.com This is a student talk, at the Web Data Management, Search and Retrieval Course, each student is is asked to present his/her synthesis paper. Course Page: http://jarrar-courses.blogspot.com/2013/11/web-data-management.html 1
  • 2. Document-oriented database • document-oriented database is a computer program designed for storing, retrieving, and managing document-oriented, or semi structured data, information
  • 3. Comparison  Document db  Relational Article - id - authorid - title - content Author - id - name - email Comment - id - articleid - message Article - _id - title - content - author - _id - name - email - comments[]
  • 4. Concepts  Joins  No joins  Joins at "design time", not at "query time“  Due to embedded docs and arrays less joins are needed  Constraints  No foreign key constraints  Unique indexes  Transactions  No commit/rollback  Atomic operations  Multiple actions inside the same document  Incl. embedded documents
  • 5. Benefits  Scalable: good for a lot of data / traffic  Horizontal scaling: to more nodes  Good for web-apps  Performance  No joins and constraints  Dev/user friendly  Data is modeled to how the app is going to use it  No conversion between object oriented > relational  No static schema = agile
  • 6. One-to-many  Embedded array / array keys  Some queries get harder  You can index arrays!  Normalized approach  More flexibility  A lot less performance Article - _id - content - tags: {“foo”, “bar”} - comments: {“id1”, “id2”}
  • 7. many-to-many  Using array keys  No join table  References on both sides Article - _id - content - category_ids : {“id1”, “id2”} Category - _id - name - article_ids: {“id7”, “id8”}  Advantage: simple queries articles.Where(p => p.CategoryIds.Contains(categoryId)) categories.Where(c => c.ArticleIds.Contains(articleId))  Disadvantage: duplication, update two docs
  • 8. json • • • Stands for Javascript Object Notation Derived from Javascript scripting language Used for representing simple data structures and associative arrays { { "_id": "BCCD12CBB", "type": "person", "name": "Darth Vader", "age": 63, "headware": ["Helmet", "Sombrero"], "dark_side": true } "_id": "BCCD12CBC", "type": "person", "name": "Luke", "age": 35, "powers": ["Pull", "Jedi Mind Trick"], "dark_side": false }
  • 9. Replication  Only one server is active for writes (the primary, or master) at a given time – this is to allow strong consistent (atomic) operations. One can optionally send read operations to the secondaries when eventual consistency semantics are acceptable.
  • 10. Sharding  Sharding is the partitioning of data among multiple machines in an order-preserving manner.(horizontal scaling ) Machine 1 Machine 2 Machine 3 Alabama → Arizona Colorado → Florida Arkansas → California Indiana → Kansas Idaho → Illinois Georgia → Hawaii Maryland → Michigan Kentucky → Maine Minnesota → Missouri Montana → Montana Nebraska → New Jersey Ohio → Pennsylvania New Mexico → North Dakota Rhode Island → South Dakota Tennessee → Utah Vermont → West Virgina Wisconsin → Wyoming
  • 11. Sharding  The set of servers/mongod process within the shard comprise a replica set
  • 12. Replication & Sharding conclusion  sharding is the tool for scaling a system, and replication is the tool for data safety, high availability, and disaster recovery. The two work in tandem yet are orthogonal concepts in the design.
  • 14. What is MongoDB?  Creator: 10 gen, former doublick  Name: short for humongous (  Language: C++ )
  • 15. What is MongoDB?  Defination: MongoDB is an open source, document- oriented database designed with both scalability and developer agility in mind. Instead of storing your data in tables and rows as you would with a relational database, in MongoDB you store JSON-like documents with dynamic schemas(schemafree, schemaless).
  • 16. What is MongoDB?  Goal: bridge the gap between key-value stores (which are fast and scalable) and relational databases (which have rich functionality).
  • 19. MongoDB Data model  Data model: Using BSON (binary JSON), developers can easily map to modern object-oriented languages without a complicated ORM layer.  BSON is a binary format in which zero or more key/value pairs are stored as a single entity.  lightweight, traversable, efficient
  • 23. Query MongoDB Vs sql? SQL mongodb Create table db.CreateCollection() Insert into db.coll.save() select db.coll.find() update db.coll.update delete db.coll.remove() drop db.coll.drop()
  • 26. API for MongoDB : C C++ C# Erlang Haskell Java node.js PHP Perl Python Ruby Scala (Casbah)