SlideShare a Scribd company logo
by Ciro Donato Caiazzo
Bologna, July 21, 2015
MongoDB for
Developers
{
"Name" : "Ciro Donato",
"Surname": "Caiazzo",
"I am": "Software Engineer",
"Working in": "SCAI Consulting",
"With Title": "Senior Developer Consultant",
"ContactMethods" : [
{"Type": "Twitter", "Value": "@CyrusD87"},
{"Type": "Linkedin", "Value": "Ciro Donato Caiazzo"},
{"Type": "Personal e-mail", "Value": "cd.caiazzo@gmail.com"},
{"Type": "Job e-mail",
"Value": "ciro.caiazzo@scai-consulting.grupposcai.it"}
],
"Some passions": ["Tecnology","Innovation","Agile","Big data"]
}
What are NoSQL?
NoSQL developed in response to a rise in the
volume of data…
…with a focus on speed, performance, flexibility
and scalability…
… for the new modern applications.
 NoSQL data model addresses issues that
relational model cannot achieve (ex. It
manage Large volumes of structured, semi-
structured, and unstructured data, etc…)
 NoSQL databases are more scalable and
provide superior performance
NoSQL
DOCUMENT
GRAPH
KEY-VALUE
WIDE-
COLUMN
What is?
 MongoDB is a non relational datastore for
JSON documents
 Written in C++
 License GNU AGPL v3.0 (more..)
MongoDBBSON
{
"skills":{
"database":[
{
"name":"Sql",
"years":"7"
},
{
"name":"MongoDB",
"years":"2"
}
]
}
}
 MongoDB uses collections for storing groups
of data.
 A collection can be thought as a table in a
relational database.
MongoDB
Collection 2
Collection 3
Collection 1
RDBMS
Table 1
Table 2
Table 3
 Schemaless means that two documents that
don't have the same schema can be stored in
the same collection.
{"_id" : "1", "skill" : {"web": [{"name": "html"}, {"name": "css"}]}}
{"_id" : "2", "skill" : {"database": [{"name": "mongoDB"}, {"name": "sql
server"}]}}
{"_id" : "3", "skill" : {"methodologies": ["scrum","kanban","xp"]}}
MongoDB does not support:
 Joins;
 Transactions across multiple collections
But each operation is atomic at level of single
document
Reason?? Scalability!
In MongoDB, documents stored in a collection
require a unique _id field that acts as a primary key
ObjectId is a 12-byte BSON type, constructed
using:
 a 4-byte value representing the seconds since
the Unix epoch,
 a 3-byte machine identifier,
 a 2-byte process id, and
 a 3-byte counter, starting with a random value.
What does it happen for date after the 2038?
(Year 2038 problem)
On Unix systems, dates are represented as seconds
from 1 January 1970 and usually stored in the
C time_t type.
MongoDB does not use time_t to represent dates
internally so do not suffer from this problem
http://api.mongodb.org/python/2.1.1/faq.html
Where to start?
InWindows
 Download and install MongoDB
 https://www.mongodb.org/downloads
 Include MongoDB (bin) path in the
environment variable ‘PATH’
 Open Command Prompt and run the
following command to create the directories
where MongoDB will save the data:
Run ‘mongod’
And now? Go to the Mongo Shell….
The mongo shell is an interactive JavaScript
shell for MongoDB
 Run ‘mongo’ command to start mongo shell
 use <your-database-name>
The above is supposed to create a database called <your-
database-name> but … MongoDB creates databases on-
demand. It will get created only when we add something to it
 db.<your-collection-name>.save(<your-json-document>)
The above statement will create a collection called <your-
collection-name>.under the database ‘<your-database-name>
 Insert
 Find
 Find (with filter)
 FindOne
 Update
 Remove
Performance
Indexes support the efficient execution of
queries in MongoDB (Default _id, Single Field,
Compound Index, Multikey Index, Geospatial
Indexes,Text Indexes,Hashed Indexes)
Aggregation
Documents enter a multi-stage pipeline that transforms the
documents into an aggregated results.
http://docs.mongodb.org/manual/core/aggregation-pipeline/
Map-reduce is a data processing paradigm for condensing large
volumes of data into useful aggregated results
http://docs.mongodb.org/manual/core/map-reduce/
Let's go over
 Replication
 Sharding
 Training
https://www.mongodb.org/
https://university.mongodb.com/
 Database-as-a-Service
https://mongolab.com
https://www.compose.io/
MongoDB for Developers
by Ciro Donato Caiazzo
Bologna, July 21, 2015

More Related Content

What's hot (20)

PDF
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB
 
PPTX
Conceptos básicos. seminario web 3 : Diseño de esquema pensado para documentos
MongoDB
 
PPTX
Mongo db workshop # 02
FarhatParveen10
 
PPTX
High Performance Applications with MongoDB
MongoDB
 
PDF
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB
 
PPTX
MongoDB 3.4: Deep Dive on Views, Zones, and MongoDB Compass
MongoDB
 
DOCX
Mongo db report
Hyphen Call
 
PPTX
MongoDB 101
Abhijeet Vaikar
 
PDF
Building your first app with MongoDB
Norberto Leite
 
PPTX
Mongo db operations_v2
Thanabalan Sathneeganandan
 
PPTX
Introduction to MongoDB
MongoDB
 
PDF
MongoDB for Coder Training (Coding Serbia 2013)
Uwe Printz
 
PDF
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB
 
PDF
The Fine Art of Schema Design in MongoDB: Dos and Don'ts
Matias Cascallares
 
PPTX
Webinar: Back to Basics: Thinking in Documents
MongoDB
 
PPTX
MongoDB Days Silicon Valley: Introducing MongoDB 3.2
MongoDB
 
PDF
MongoDB .local Toronto 2019: MongoDB Atlas Search Deep Dive
MongoDB
 
PPTX
MongoDB
nikhil2807
 
PDF
Introduction to MongoDB
Justin Smestad
 
PPTX
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
SpringPeople
 
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB
 
Conceptos básicos. seminario web 3 : Diseño de esquema pensado para documentos
MongoDB
 
Mongo db workshop # 02
FarhatParveen10
 
High Performance Applications with MongoDB
MongoDB
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB
 
MongoDB 3.4: Deep Dive on Views, Zones, and MongoDB Compass
MongoDB
 
Mongo db report
Hyphen Call
 
MongoDB 101
Abhijeet Vaikar
 
Building your first app with MongoDB
Norberto Leite
 
Mongo db operations_v2
Thanabalan Sathneeganandan
 
Introduction to MongoDB
MongoDB
 
MongoDB for Coder Training (Coding Serbia 2013)
Uwe Printz
 
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB
 
The Fine Art of Schema Design in MongoDB: Dos and Don'ts
Matias Cascallares
 
Webinar: Back to Basics: Thinking in Documents
MongoDB
 
MongoDB Days Silicon Valley: Introducing MongoDB 3.2
MongoDB
 
MongoDB .local Toronto 2019: MongoDB Atlas Search Deep Dive
MongoDB
 
MongoDB
nikhil2807
 
Introduction to MongoDB
Justin Smestad
 
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
SpringPeople
 

Viewers also liked (16)

PPTX
Back to Basics Webinar 1: Introduction to NoSQL
MongoDB
 
PPTX
Back to Basics Webinar 6: Production Deployment
MongoDB
 
PPTX
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
MongoDB
 
PDF
MongoDB Schema Design (Event: An Evening with MongoDB Houston 3/11/15)
MongoDB
 
PPTX
Back to Basics Webinar 2: Your First MongoDB Application
MongoDB
 
PPTX
Back to Basics Webinar 5: Introduction to the Aggregation Framework
MongoDB
 
PPTX
Back to Basics Webinar 3: Schema Design Thinking in Documents
MongoDB
 
PPTX
Beyond the Basics 1: Storage Engines
MongoDB
 
PPTX
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
MongoDB
 
KEY
OSCON 2012 MongoDB Tutorial
Steven Francia
 
PDF
Mongo db data-models guide
Deysi Gmarra
 
PPTX
Back to Basics, webinar 4: Indicizzazione avanzata, indici testuali e geospaz...
MongoDB
 
PPTX
Webinar: Getting Started with MongoDB - Back to Basics
MongoDB
 
PDF
Advanced Schema Design Patterns
MongoDB
 
PPTX
Back to Basics: My First MongoDB Application
MongoDB
 
PPTX
Developing with the Modern App Stack: MEAN and MERN (with Angular2 and ReactJS)
MongoDB
 
Back to Basics Webinar 1: Introduction to NoSQL
MongoDB
 
Back to Basics Webinar 6: Production Deployment
MongoDB
 
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
MongoDB
 
MongoDB Schema Design (Event: An Evening with MongoDB Houston 3/11/15)
MongoDB
 
Back to Basics Webinar 2: Your First MongoDB Application
MongoDB
 
Back to Basics Webinar 5: Introduction to the Aggregation Framework
MongoDB
 
Back to Basics Webinar 3: Schema Design Thinking in Documents
MongoDB
 
Beyond the Basics 1: Storage Engines
MongoDB
 
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
MongoDB
 
OSCON 2012 MongoDB Tutorial
Steven Francia
 
Mongo db data-models guide
Deysi Gmarra
 
Back to Basics, webinar 4: Indicizzazione avanzata, indici testuali e geospaz...
MongoDB
 
Webinar: Getting Started with MongoDB - Back to Basics
MongoDB
 
Advanced Schema Design Patterns
MongoDB
 
Back to Basics: My First MongoDB Application
MongoDB
 
Developing with the Modern App Stack: MEAN and MERN (with Angular2 and ReactJS)
MongoDB
 
Ad

Similar to MongoDB for Developers (20)

PPTX
Mongo db
Gyanendra Yadav
 
PPTX
Mongo db Quick Guide
Sourabh Sahu
 
PPTX
Kalp Corporate MongoDB Tutorials
Kalp Corporate
 
PPTX
05201349_Unit_7_FSWD_ advanced learning.pptx
ozakamal8
 
PPTX
05201349_Unit_7_FSWD_II(1) with advance.pptx
ozakamal8
 
PDF
MongoDB NoSQL database a deep dive -MyWhitePaper
Rajesh Kumar
 
PPTX
Introduction to MongoDB.pptx
Surya937648
 
PDF
MongoDB Interview Questions PDF By ScholarHat
Scholarhat
 
PPTX
NOSQL and MongoDB Database
Tariqul islam
 
PDF
MongoDB - An Introduction
sethfloydjr
 
PDF
Mongo db basics
Claudio Montoya
 
PDF
Introduction to MongoDB Basics from SQL to NoSQL
Mayur Patil
 
PDF
MongoDB Interview Questions PDF By ScholarHat
Scholarhat
 
PDF
MongoDB
wiTTyMinds1
 
PPTX
Klevis Mino: MongoDB
Carlo Vaccari
 
PDF
Quick & Dirty & MEAN
Troy Miles
 
PPTX
Nosql
ROXTAD71
 
PPTX
Mongo db
AbhiKhurana8
 
PPTX
Nosql
Roxana Tadayon
 
Mongo db
Gyanendra Yadav
 
Mongo db Quick Guide
Sourabh Sahu
 
Kalp Corporate MongoDB Tutorials
Kalp Corporate
 
05201349_Unit_7_FSWD_ advanced learning.pptx
ozakamal8
 
05201349_Unit_7_FSWD_II(1) with advance.pptx
ozakamal8
 
MongoDB NoSQL database a deep dive -MyWhitePaper
Rajesh Kumar
 
Introduction to MongoDB.pptx
Surya937648
 
MongoDB Interview Questions PDF By ScholarHat
Scholarhat
 
NOSQL and MongoDB Database
Tariqul islam
 
MongoDB - An Introduction
sethfloydjr
 
Mongo db basics
Claudio Montoya
 
Introduction to MongoDB Basics from SQL to NoSQL
Mayur Patil
 
MongoDB Interview Questions PDF By ScholarHat
Scholarhat
 
MongoDB
wiTTyMinds1
 
Klevis Mino: MongoDB
Carlo Vaccari
 
Quick & Dirty & MEAN
Troy Miles
 
Nosql
ROXTAD71
 
Mongo db
AbhiKhurana8
 
Ad

Recently uploaded (20)

PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 

MongoDB for Developers

  • 1. by Ciro Donato Caiazzo Bologna, July 21, 2015 MongoDB for Developers
  • 2. { "Name" : "Ciro Donato", "Surname": "Caiazzo", "I am": "Software Engineer", "Working in": "SCAI Consulting", "With Title": "Senior Developer Consultant", "ContactMethods" : [ {"Type": "Twitter", "Value": "@CyrusD87"}, {"Type": "Linkedin", "Value": "Ciro Donato Caiazzo"}, {"Type": "Personal e-mail", "Value": "[email protected]"}, {"Type": "Job e-mail", "Value": "[email protected]"} ], "Some passions": ["Tecnology","Innovation","Agile","Big data"] }
  • 4. NoSQL developed in response to a rise in the volume of data… …with a focus on speed, performance, flexibility and scalability… … for the new modern applications.
  • 5.  NoSQL data model addresses issues that relational model cannot achieve (ex. It manage Large volumes of structured, semi- structured, and unstructured data, etc…)  NoSQL databases are more scalable and provide superior performance
  • 8.  MongoDB is a non relational datastore for JSON documents  Written in C++  License GNU AGPL v3.0 (more..) MongoDBBSON { "skills":{ "database":[ { "name":"Sql", "years":"7" }, { "name":"MongoDB", "years":"2" } ] } }
  • 9.  MongoDB uses collections for storing groups of data.  A collection can be thought as a table in a relational database. MongoDB Collection 2 Collection 3 Collection 1 RDBMS Table 1 Table 2 Table 3
  • 10.  Schemaless means that two documents that don't have the same schema can be stored in the same collection. {"_id" : "1", "skill" : {"web": [{"name": "html"}, {"name": "css"}]}} {"_id" : "2", "skill" : {"database": [{"name": "mongoDB"}, {"name": "sql server"}]}} {"_id" : "3", "skill" : {"methodologies": ["scrum","kanban","xp"]}}
  • 11. MongoDB does not support:  Joins;  Transactions across multiple collections But each operation is atomic at level of single document Reason?? Scalability!
  • 12. In MongoDB, documents stored in a collection require a unique _id field that acts as a primary key ObjectId is a 12-byte BSON type, constructed using:  a 4-byte value representing the seconds since the Unix epoch,  a 3-byte machine identifier,  a 2-byte process id, and  a 3-byte counter, starting with a random value.
  • 13. What does it happen for date after the 2038? (Year 2038 problem) On Unix systems, dates are represented as seconds from 1 January 1970 and usually stored in the C time_t type. MongoDB does not use time_t to represent dates internally so do not suffer from this problem http://api.mongodb.org/python/2.1.1/faq.html
  • 15. InWindows  Download and install MongoDB  https://www.mongodb.org/downloads
  • 16.  Include MongoDB (bin) path in the environment variable ‘PATH’  Open Command Prompt and run the following command to create the directories where MongoDB will save the data:
  • 17. Run ‘mongod’ And now? Go to the Mongo Shell….
  • 18. The mongo shell is an interactive JavaScript shell for MongoDB  Run ‘mongo’ command to start mongo shell
  • 19.  use <your-database-name> The above is supposed to create a database called <your- database-name> but … MongoDB creates databases on- demand. It will get created only when we add something to it  db.<your-collection-name>.save(<your-json-document>) The above statement will create a collection called <your- collection-name>.under the database ‘<your-database-name>
  • 21.  Find (with filter)  FindOne
  • 24. Indexes support the efficient execution of queries in MongoDB (Default _id, Single Field, Compound Index, Multikey Index, Geospatial Indexes,Text Indexes,Hashed Indexes)
  • 26. Documents enter a multi-stage pipeline that transforms the documents into an aggregated results. http://docs.mongodb.org/manual/core/aggregation-pipeline/
  • 27. Map-reduce is a data processing paradigm for condensing large volumes of data into useful aggregated results http://docs.mongodb.org/manual/core/map-reduce/
  • 31. MongoDB for Developers by Ciro Donato Caiazzo Bologna, July 21, 2015

Editor's Notes

  • #7: There are other kinds of NoSQL: Geospatial, File System, Object, in-memory
  • #9: JSON (Javascript Object Notation) is an open standard format to transmit data between a server and web application.
  • #10: A collection contains a set of JSON documents (also with sub-documents)
  • #13: Unix epoch starts the 1° of january 1960
  • #14: Unix epoch starts the 1° of january 1960
  • #17: \data \data\db Are directories where mongoDB save datas (just like schema, collections, log, etc)
  • #18: ‘mongod’ is the primary daemon process for the MongoDB system
  • #19: Mongo shell by default is connected to schema ‘test’
  • #20: The save() method uses either the ‘insert or the ’update’ command If the document does not contain an _id field, then the save() method calls the insert() method. During the operation, the mongo shell will create an ObjectId and assign it to the _id field.
  • #22: FindOne() returns only one document that matches the query criteria, if there are multiple documents that satisfy the criterias, the command will return only the first document according to the natural order which reflects the order of documents on the disk.
  • #23: justOne (Optional). To limit the deletion to just one document, set to true. Omit to use the default value of false and delete all documents matching the deletion criteria.