SlideShare a Scribd company logo
1 of 31
July 2015 - Tech Sharing
 Architecture
 Data Model
 Query Language
 Data Management
 References
 A storage engine is the part of a database that is responsible for managing how data is stored on disk.
 Many databases support multiple storage engines, where different engines perform better for specific
workloads.
For example, one storage engine might offer better performance for read-heavy workloads, and another
might support a higher-throughput for write operations
 You can have a replica set members that use different storage engines
MongoDB
Example relational data model for a blogging
application
Data as documents: simpler for developers,
faster for users.
 Dynamic/Flexible
 Collections (Tables) can be created without defining structure of the documents
 Documents in a collection need not have an identical set of fields.
 In practice, it is common for the documents in a collection to have a largely
homogeneous structure; however, this is not a requirement
 The structure of documents can be changed simply by adding new fields or deleting
existing ones (which simplifies and facilitates iterative software development)
 Schema Design is still important!
 Types of queries the application will perform
 How objects are managed in application code
 How documents will change over time
Repetition of publisher data If the number of books per publisher
is small with limited growth
To avoid mutable, growing arrays,
store the publisher reference inside
the book document
If your application frequently retrieves
the address data with the name information,
then your application needs to issue multiple queries
With the embedded data model,
your application can retrieve the
complete patron information with one query
MongoDB
 Core processes
 mongod – database process
 mongos – controller/query router of sharded clusters
 mongo – interactive mongoDB shell
 Import / Export Tools
 Binary
 mongodump – create BSON dump files
 mongorestore – restore BSON dump files
 Bsondump – convert BSON dump files to JSON
 mongooplog – stream oplog entries outside of normal replication
 JSON/CSV/TSV
 mongoimport – taking data
 mongoexport – export data
 Diagnostic Tools
 mongostat – status of currently running mongod or mongos instance
 mongotop - the amount of time statistics on a per-collection level a MongoDB instance spends reading and writing data
 mongosniff - a low-level operation tracing/sniffing view into database activity in real time (only in Unix)
 mongoperf - utility to check disk I/O performance independently of MongoDB
 GridFS
 Mongofiles - utility makes it possible to manipulate files stored in your MongoDB instance in GridFS objects from the command line
 Linux
 mongod --dbpath <path to data directory>
 Windows
 mongod.exe --dbpath <path to data directory>
 Rich, interactive JavaScript shell
 Included in all MongoDB distributions
 Think sqlcmd in MS SQL or sqlplus in Oracle
 Support all commands/queries, including administrative operations
 A collection can be created by inserting row(s)
 find
 Query criteria
 Projection
 Cursor modifier
 Pretty
 findOne
 update
 $set/$unset
 Replace whole document
 Array (addToSet, push, pop)
 upsert
 findAndModify
 upsert
 Remove
 New
 drop the collection
 remove
 All records
 Based on criteria (multiple rows by default)
 justOne parameter
 findAndModify with remove option
 aggregate - Aggregation Pipeline (recommended/preferred)
 mapReduce - Map Reduce
 group
 Supported drivers: Java, .NET, Ruby, PHP, JavaScript, node.js, Python,
Perl, PHP, Scala and others
 Implemented as methods or functions within the API of a specific
programming language, as opposed to a completely separate language like
SQL
 [Example here]
 Types:
 Unique Indexes
 Compound Indexes
 Array Indexes - For fields that contain an array, each array value is stored as a separate index
entry
 TTL (Time to Live) Indexes - allow the user to specify a period of time after which the data
will automatically be deleted from the database
 Geospatial Indexes - optimize queries related to location within a two dimensional space
 Sparse Indexes - allow for smaller, more efficient indexes when fields are not present in all
documents.
 Text Search Indexes - uses advanced, language-specific linguistic rules for stemming,
tokenization and stop words
 Covered Queries - Queries that return results containing only indexed fields can be
returned without reading from the source documents
MongoDB
Sharding and replica sets:
- automatic sharding provides horizontal scalability
- replica sets help prevent database downtime
 Sharding, or horizontal scaling, divides the data set and distributes the
data over multiple servers, or shards. Each shard is an independent
database, and collectively, the shards make up a single logical database.
 Replication provides redundancy and increases data availability.
 With multiple copies of data on different database servers, replication
protects a database from the loss of a single server
 Find/Identify/Target the most frequent (>80%) data access pattern
 Flexible Schema promotes “Agile”, be prepared for “Changes” to the data
model for improvements
 For storages
 Use the _id field explicitly (else will default to 12-bytes ObjectId)
 Use shorter field names
 Embed documents (data model consideration)
 Use Index & Profiling for performance
 docs.mongodb.org has very wealthy resources (offline file(s) is available
at http://docs.mongodb.org/manual/about)
 Documentation (http://docs.mongodb.org)
 Free Online Training (http://university.mongodb.com)
 Presentations (http://mongodb.com/presentations)
 Case Studies (http://mongodb.com/customers)
 http://www.newtonsoft.com/json
bembengarifin@gmail.com

More Related Content

What's hot

MongoDB for Beginners
MongoDB for BeginnersMongoDB for Beginners
MongoDB for BeginnersEnoch Joshua
 
Mongo Presentation by Metatagg Solutions
Mongo Presentation by Metatagg SolutionsMongo Presentation by Metatagg Solutions
Mongo Presentation by Metatagg SolutionsMetatagg Solutions
 
PhpstudyTokyo MongoDB PHP CakePHP
PhpstudyTokyo MongoDB PHP CakePHPPhpstudyTokyo MongoDB PHP CakePHP
PhpstudyTokyo MongoDB PHP CakePHPichikaway
 
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
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBAlex Bilbie
 
MongoDB : The Definitive Guide
MongoDB : The Definitive GuideMongoDB : The Definitive Guide
MongoDB : The Definitive GuideWildan Maulana
 
Building a Scalable Inbox System with MongoDB and Java
Building a Scalable Inbox System with MongoDB and JavaBuilding a Scalable Inbox System with MongoDB and Java
Building a Scalable Inbox System with MongoDB and Javaantoinegirbal
 
Back to Basics Webinar 3: Schema Design Thinking in Documents
 Back to Basics Webinar 3: Schema Design Thinking in Documents Back to Basics Webinar 3: Schema Design Thinking in Documents
Back to Basics Webinar 3: Schema Design Thinking in DocumentsMongoDB
 
Webinar: Back to Basics: Thinking in Documents
Webinar: Back to Basics: Thinking in DocumentsWebinar: Back to Basics: Thinking in Documents
Webinar: Back to Basics: Thinking in DocumentsMongoDB
 
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial IndexesBack to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial IndexesMongoDB
 
Webinar: Getting Started with MongoDB - Back to Basics
Webinar: Getting Started with MongoDB - Back to BasicsWebinar: Getting Started with MongoDB - Back to Basics
Webinar: Getting Started with MongoDB - Back to BasicsMongoDB
 
5 Pitfalls to Avoid with MongoDB
5 Pitfalls to Avoid with MongoDB5 Pitfalls to Avoid with MongoDB
5 Pitfalls to Avoid with MongoDBTim Callaghan
 
Intro To Mongo Db
Intro To Mongo DbIntro To Mongo Db
Intro To Mongo Dbchriskite
 
Back to Basics: My First MongoDB Application
Back to Basics: My First MongoDB ApplicationBack to Basics: My First MongoDB Application
Back to Basics: My First MongoDB ApplicationMongoDB
 

What's hot (20)

MongoDB for Beginners
MongoDB for BeginnersMongoDB for Beginners
MongoDB for Beginners
 
MongoDB 101
MongoDB 101MongoDB 101
MongoDB 101
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
 
Mongo Presentation by Metatagg Solutions
Mongo Presentation by Metatagg SolutionsMongo Presentation by Metatagg Solutions
Mongo Presentation by Metatagg Solutions
 
PhpstudyTokyo MongoDB PHP CakePHP
PhpstudyTokyo MongoDB PHP CakePHPPhpstudyTokyo MongoDB PHP CakePHP
PhpstudyTokyo MongoDB PHP CakePHP
 
Mongo DB 102
Mongo DB 102Mongo DB 102
Mongo DB 102
 
Mongo db basics
Mongo db basicsMongo db basics
Mongo db basics
 
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
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
MongoDB : The Definitive Guide
MongoDB : The Definitive GuideMongoDB : The Definitive Guide
MongoDB : The Definitive Guide
 
Building a Scalable Inbox System with MongoDB and Java
Building a Scalable Inbox System with MongoDB and JavaBuilding a Scalable Inbox System with MongoDB and Java
Building a Scalable Inbox System with MongoDB and Java
 
Back to Basics Webinar 3: Schema Design Thinking in Documents
 Back to Basics Webinar 3: Schema Design Thinking in Documents Back to Basics Webinar 3: Schema Design Thinking in Documents
Back to Basics Webinar 3: Schema Design Thinking in Documents
 
Mongo db queries
Mongo db queriesMongo db queries
Mongo db queries
 
Mongo DB Presentation
Mongo DB PresentationMongo DB Presentation
Mongo DB Presentation
 
Webinar: Back to Basics: Thinking in Documents
Webinar: Back to Basics: Thinking in DocumentsWebinar: Back to Basics: Thinking in Documents
Webinar: Back to Basics: Thinking in Documents
 
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial IndexesBack to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
 
Webinar: Getting Started with MongoDB - Back to Basics
Webinar: Getting Started with MongoDB - Back to BasicsWebinar: Getting Started with MongoDB - Back to Basics
Webinar: Getting Started with MongoDB - Back to Basics
 
5 Pitfalls to Avoid with MongoDB
5 Pitfalls to Avoid with MongoDB5 Pitfalls to Avoid with MongoDB
5 Pitfalls to Avoid with MongoDB
 
Intro To Mongo Db
Intro To Mongo DbIntro To Mongo Db
Intro To Mongo Db
 
Back to Basics: My First MongoDB Application
Back to Basics: My First MongoDB ApplicationBack to Basics: My First MongoDB Application
Back to Basics: My First MongoDB Application
 

Similar to MongoDB

MongoDB: An Introduction - July 2011
MongoDB:  An Introduction - July 2011MongoDB:  An Introduction - July 2011
MongoDB: An Introduction - July 2011Chris Westin
 
Mongo db halloween party
Mongo db halloween partyMongo db halloween party
Mongo db halloween partyAndrea Balducci
 
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).pptxRushikeshChikane2
 
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
 
Klevis Mino: MongoDB
Klevis Mino: MongoDBKlevis Mino: MongoDB
Klevis Mino: MongoDBCarlo Vaccari
 
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
 
MongoDB: An Introduction - june-2011
MongoDB:  An Introduction - june-2011MongoDB:  An Introduction - june-2011
MongoDB: An Introduction - june-2011Chris Westin
 
MongoDB - An Introduction
MongoDB - An IntroductionMongoDB - An Introduction
MongoDB - An Introductiondinkar thakur
 
NOSQL and MongoDB Database
NOSQL and MongoDB DatabaseNOSQL and MongoDB Database
NOSQL and MongoDB DatabaseTariqul islam
 
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
 
Top MongoDB interview Questions and Answers
Top MongoDB interview Questions and AnswersTop MongoDB interview Questions and Answers
Top MongoDB interview Questions and Answersjeetendra mandal
 
Mongo db transcript
Mongo db transcriptMongo db transcript
Mongo db transcriptfoliba
 
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...ijcsity
 
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...ijcsity
 
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...ijcsity
 
Performance analysis of MongoDB and HBase
Performance analysis of MongoDB and HBasePerformance analysis of MongoDB and HBase
Performance analysis of MongoDB and HBaseSindhujanDhayalan
 

Similar to MongoDB (20)

MongoDB: An Introduction - July 2011
MongoDB:  An Introduction - July 2011MongoDB:  An Introduction - July 2011
MongoDB: An Introduction - July 2011
 
Mongo db halloween party
Mongo db halloween partyMongo db halloween party
Mongo db halloween party
 
MongoDb - Details on the POC
MongoDb - Details on the POCMongoDb - Details on the POC
MongoDb - Details on the POC
 
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
 
No sql - { If and Else }
No sql - { If and Else }No sql - { If and Else }
No sql - { If and Else }
 
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
 
Klevis Mino: MongoDB
Klevis Mino: MongoDBKlevis Mino: MongoDB
Klevis Mino: MongoDB
 
Mongo db dhruba
Mongo db dhrubaMongo db dhruba
Mongo db dhruba
 
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
 
MongoDB: An Introduction - june-2011
MongoDB:  An Introduction - june-2011MongoDB:  An Introduction - june-2011
MongoDB: An Introduction - june-2011
 
MongoDB - An Introduction
MongoDB - An IntroductionMongoDB - An Introduction
MongoDB - An Introduction
 
NOSQL and MongoDB Database
NOSQL and MongoDB DatabaseNOSQL and MongoDB Database
NOSQL and MongoDB Database
 
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
 
Mongo db
Mongo dbMongo db
Mongo db
 
Top MongoDB interview Questions and Answers
Top MongoDB interview Questions and AnswersTop MongoDB interview Questions and Answers
Top MongoDB interview Questions and Answers
 
Mongo db transcript
Mongo db transcriptMongo db transcript
Mongo db transcript
 
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
 
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
 
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
 
Performance analysis of MongoDB and HBase
Performance analysis of MongoDB and HBasePerformance analysis of MongoDB and HBase
Performance analysis of MongoDB and HBase
 

Recently uploaded

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 

Recently uploaded (20)

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 

MongoDB

  • 1. July 2015 - Tech Sharing
  • 2.  Architecture  Data Model  Query Language  Data Management  References
  • 3.
  • 4.  A storage engine is the part of a database that is responsible for managing how data is stored on disk.  Many databases support multiple storage engines, where different engines perform better for specific workloads. For example, one storage engine might offer better performance for read-heavy workloads, and another might support a higher-throughput for write operations  You can have a replica set members that use different storage engines
  • 6. Example relational data model for a blogging application Data as documents: simpler for developers, faster for users.
  • 7.
  • 8.
  • 9.  Dynamic/Flexible  Collections (Tables) can be created without defining structure of the documents  Documents in a collection need not have an identical set of fields.  In practice, it is common for the documents in a collection to have a largely homogeneous structure; however, this is not a requirement  The structure of documents can be changed simply by adding new fields or deleting existing ones (which simplifies and facilitates iterative software development)  Schema Design is still important!  Types of queries the application will perform  How objects are managed in application code  How documents will change over time
  • 10. Repetition of publisher data If the number of books per publisher is small with limited growth To avoid mutable, growing arrays, store the publisher reference inside the book document
  • 11. If your application frequently retrieves the address data with the name information, then your application needs to issue multiple queries With the embedded data model, your application can retrieve the complete patron information with one query
  • 13.  Core processes  mongod – database process  mongos – controller/query router of sharded clusters  mongo – interactive mongoDB shell  Import / Export Tools  Binary  mongodump – create BSON dump files  mongorestore – restore BSON dump files  Bsondump – convert BSON dump files to JSON  mongooplog – stream oplog entries outside of normal replication  JSON/CSV/TSV  mongoimport – taking data  mongoexport – export data  Diagnostic Tools  mongostat – status of currently running mongod or mongos instance  mongotop - the amount of time statistics on a per-collection level a MongoDB instance spends reading and writing data  mongosniff - a low-level operation tracing/sniffing view into database activity in real time (only in Unix)  mongoperf - utility to check disk I/O performance independently of MongoDB  GridFS  Mongofiles - utility makes it possible to manipulate files stored in your MongoDB instance in GridFS objects from the command line
  • 14.  Linux  mongod --dbpath <path to data directory>  Windows  mongod.exe --dbpath <path to data directory>
  • 15.  Rich, interactive JavaScript shell  Included in all MongoDB distributions  Think sqlcmd in MS SQL or sqlplus in Oracle  Support all commands/queries, including administrative operations
  • 16.
  • 17.  A collection can be created by inserting row(s)
  • 18.  find  Query criteria  Projection  Cursor modifier  Pretty  findOne
  • 19.  update  $set/$unset  Replace whole document  Array (addToSet, push, pop)  upsert  findAndModify  upsert  Remove  New
  • 20.  drop the collection  remove  All records  Based on criteria (multiple rows by default)  justOne parameter  findAndModify with remove option
  • 21.  aggregate - Aggregation Pipeline (recommended/preferred)  mapReduce - Map Reduce  group
  • 22.  Supported drivers: Java, .NET, Ruby, PHP, JavaScript, node.js, Python, Perl, PHP, Scala and others  Implemented as methods or functions within the API of a specific programming language, as opposed to a completely separate language like SQL  [Example here]
  • 23.  Types:  Unique Indexes  Compound Indexes  Array Indexes - For fields that contain an array, each array value is stored as a separate index entry  TTL (Time to Live) Indexes - allow the user to specify a period of time after which the data will automatically be deleted from the database  Geospatial Indexes - optimize queries related to location within a two dimensional space  Sparse Indexes - allow for smaller, more efficient indexes when fields are not present in all documents.  Text Search Indexes - uses advanced, language-specific linguistic rules for stemming, tokenization and stop words  Covered Queries - Queries that return results containing only indexed fields can be returned without reading from the source documents
  • 25. Sharding and replica sets: - automatic sharding provides horizontal scalability - replica sets help prevent database downtime
  • 26.  Sharding, or horizontal scaling, divides the data set and distributes the data over multiple servers, or shards. Each shard is an independent database, and collectively, the shards make up a single logical database.
  • 27.  Replication provides redundancy and increases data availability.  With multiple copies of data on different database servers, replication protects a database from the loss of a single server
  • 28.  Find/Identify/Target the most frequent (>80%) data access pattern  Flexible Schema promotes “Agile”, be prepared for “Changes” to the data model for improvements  For storages  Use the _id field explicitly (else will default to 12-bytes ObjectId)  Use shorter field names  Embed documents (data model consideration)  Use Index & Profiling for performance  docs.mongodb.org has very wealthy resources (offline file(s) is available at http://docs.mongodb.org/manual/about)
  • 29.  Documentation (http://docs.mongodb.org)  Free Online Training (http://university.mongodb.com)  Presentations (http://mongodb.com/presentations)  Case Studies (http://mongodb.com/customers)  http://www.newtonsoft.com/json
  • 30.

Editor's Notes

  1. https://www.mongodb.com/blog/post/whats-new-mongodb-30-part-3-performance-efficiency-gains-new-storage-architecture
  2. http://bsonspec.org/ http://www.newtonsoft.com/json
  3. http://docs.mongodb.org/manual/reference/bios-example-collection/ http://bsonspec.org/faq.html
  4. http://docs.mongodb.org/manual/reference/sql-comparison/
  5. http://docs.mongodb.org/manual/faq/fundamentals/ http://docs.mongodb.org/manual/core/data-modeling-introduction/
  6. http://docs.mongodb.org/manual/tutorial/model-referenced-one-to-many-relationships-between-documents/#data-modeling-publisher-and-books
  7. https://docs.mongodb.org/manual/reference/program/
  8. http://docs.mongodb.org/manual/administration/install-on-linux/ http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/
  9. http://docs.mongodb.org/manual/administration/scripting/
  10. http://docs.mongodb.org/manual/core/read-operations-introduction/
  11. http://docs.mongodb.org/manual/reference/operator/query/
  12. http://docs.mongodb.org/manual/reference/aggregation-commands-comparison/ http://docs.mongodb.org/manual/meta/aggregation-quick-reference/
  13. http://docs.mongodb.org/ecosystem/drivers/
  14. http://docs.mongodb.org/manual/administration/analyzing-mongodb-performance
  15. https://university.mongodb.com/