SlideShare a Scribd company logo
1 of 20
Starting Soon…
Database Workshop
Ido Ben Haim
Daniyal Bokhari
Discover the power of MongoDB: A
beginner-friendly workshop
● Organized collection of information and data stored electronically
● Typically set up for efficient access and modification of the data
● Databases typically communicate with the application’s backend to
store/get information which is then sent to the user
What are Databases?
Clients Backend/
REST API
Database
TL;DR: because speeeeeed
Why not store everything in
files?
• Storing data in files can become messy and
difficult to manage with large amounts of
information
• Databases make it more efficient to access
information and filter results
• Data can be stored in a structured way making it
easier to manage and scale
● The JSON format is a way to store data in a key value
manner.
● MongoDB uses the JSON format to store information
in the form of documents (you’ll learn more about
those later).
P.S JSON stands for JavaScript Object Notation
The JSON format
// example JSON file
{
“username”: “cooluser123”,
“password”: “TooC00lTOGu3ss”,
“friends”: [“friendlyuser321”, “otheruser123”]
}
What’s the difference?
SQL vs NoSQL DBs
• SQL databases store data in tables containing
columns and rows, tables can be related to one
another using keys, relational database management
system (RDBMS)
• SQL databases are useful when data is organized and
structured in specific ways
• SQL databases use Structured Query Language in
order to access and manage data
What’s the difference?
SQL vs NoSQL DBs
• NoSQL databases store data in documents (JSON,
BSON, etc), key-value storage, column-oriented
storage, graph-databases
• NoSQL databases are useful for data that is
unstructured, documents in the database can
have different structures
• Have dynamic schemas
Graph Database
In short; a database server
● MongoDB is a NoSQL database service which lets developers store data in
a flexible manner.
● MongoDB is free to use for anyone in the world
● MongoDB has gained popularity in recent years due to its ease of use,
scalability, and performance.
● MongoDB can be used in a wide range of applications, including web
applications, content management systems, mobile apps, and more.
What is MongoDB
MongoDB VS MySQL
When to use which?
MongoDB’s document layout allows
you to store data which might not
exist in documents within the same
collection.
MySQL’s rigid data structures enforce
uniformity and is less error-prone.
MongoDB allows you to index large
documents, making it faster to search
them
MySQL allows for storing data with
complex relationships between one
another (e.g friends on facebook)
MongoDB Basics
• MongoDB databases contain collections of
documents
• Collections store documents, which can
each have different schemas
• Data is stored in BSON documents, a
binary representation of JSON documents
• Documents store data in field-value pairs,
each field-value pair has a unique ID
Databases, collections, and documents
Database
Collection Collection Collection
Document
Document
Document Document Document
Document
Document
Document
Document
Getting started with MongoDB Atlas
● MongoDB Atlas is a platform that
allows you to host a MongoDB
server for free (with some
limitations)
● To get started go to
https://www.mongodb.com/atlas/
● Click “Try Free”
Its as simple as opening an account!
Getting started with MongoDB Atlas
● Sign Up by filling out the signup
form
● Leave the company field blank, it is
optional
Its as simple as opening an account!
Getting started with MongoDB Atlas
● Verify your email address
● After verifying your email address,
you’ll be prompted to deploy a
database, just select the free option
and give it a fitting name
● We’ll name it “demo”
Its as simple as opening an account!
Getting started with MongoDB Atlas
● Once you have your database finish
setting it up by making a database
user
Its as simple as opening an account!
Getting started with MongoDB Atlas
● Make sure you allow access from
anywhere by adding 0.0.0.0 as an
allowed ip address
Its as simple as opening an account!
Getting started with MongoDB Atlas
Its as simple as opening an account!
Connecting to your database
● Press on the “connect” button
beside your demo deployment
● Press “connect to your application”
> Set the driver to Python and
choose your version > copy the
connection string
step-by-step
Connecting to your database
● Open up the demo .py file shared to the chat
● In your terminal (VS Code terminal, Pycharm Terminal, command prompt)
run the command pip install pymongo (make sure you have pip already
installed)
Step-by-step
Connecting to your database
● Create a connection to your
database using MongoClient and the
connection string you copied
○ Change the <password> field to the
password you set for your database
user
● On MacOS, you may need to include
an additional argument, a
certification to connect
step-by-step
client = MongoClient('<connection string>')
client = MongoClient('<connection string>',
tlsCAFile=certifi.where())

More Related Content

Similar to Database Workshop Slides

Top MongoDB interview Questions and Answers
Top MongoDB interview Questions and AnswersTop MongoDB interview Questions and Answers
Top MongoDB interview Questions and Answersjeetendra mandal
 
MongoDB.local Sydney: An Introduction to Document Databases with MongoDB
MongoDB.local Sydney: An Introduction to Document Databases with MongoDBMongoDB.local Sydney: An Introduction to Document Databases with MongoDB
MongoDB.local Sydney: An Introduction to Document Databases with MongoDBMongoDB
 
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 NoSQLMayur Patil
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB Habilelabs
 
Introduction to MongoDB and CRUD operations
Introduction to MongoDB and CRUD operationsIntroduction to MongoDB and CRUD operations
Introduction to MongoDB and CRUD operationsAnand Kumar
 
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
 
Dev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBDev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBMongoDB
 
MongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data scienceMongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data sciencebitragowthamkumar1
 
3-Mongodb and Mapreduce Programming.pdf
3-Mongodb and Mapreduce Programming.pdf3-Mongodb and Mapreduce Programming.pdf
3-Mongodb and Mapreduce Programming.pdfMarianJRuben
 
Building your first app with MongoDB
Building your first app with MongoDBBuilding your first app with MongoDB
Building your first app with MongoDBNorberto Leite
 
Kalp Corporate MongoDB Tutorials
Kalp Corporate MongoDB TutorialsKalp Corporate MongoDB Tutorials
Kalp Corporate MongoDB TutorialsKalp Corporate
 
Mongodb Training Tutorial in Bangalore
Mongodb Training Tutorial in BangaloreMongodb Training Tutorial in Bangalore
Mongodb Training Tutorial in Bangalorerajkamaltibacademy
 
nosql [Autosaved].pptx
nosql [Autosaved].pptxnosql [Autosaved].pptx
nosql [Autosaved].pptxIndrani Sen
 

Similar to Database Workshop Slides (20)

Top MongoDB interview Questions and Answers
Top MongoDB interview Questions and AnswersTop MongoDB interview Questions and Answers
Top MongoDB interview Questions and Answers
 
MongoDB.local Sydney: An Introduction to Document Databases with MongoDB
MongoDB.local Sydney: An Introduction to Document Databases with MongoDBMongoDB.local Sydney: An Introduction to Document Databases with MongoDB
MongoDB.local Sydney: An Introduction to Document Databases with MongoDB
 
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
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
 
Introduction to MongoDB and CRUD operations
Introduction to MongoDB and CRUD operationsIntroduction to MongoDB and CRUD operations
Introduction to MongoDB and CRUD operations
 
MongoDB DOC v1.5
MongoDB DOC v1.5MongoDB DOC v1.5
MongoDB DOC v1.5
 
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
 
Dev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBDev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDB
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
MongoDB
MongoDBMongoDB
MongoDB
 
MongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data scienceMongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data science
 
Mongodb
MongodbMongodb
Mongodb
 
3-Mongodb and Mapreduce Programming.pdf
3-Mongodb and Mapreduce Programming.pdf3-Mongodb and Mapreduce Programming.pdf
3-Mongodb and Mapreduce Programming.pdf
 
Building your first app with MongoDB
Building your first app with MongoDBBuilding your first app with MongoDB
Building your first app with MongoDB
 
Mongo db basics
Mongo db basicsMongo db basics
Mongo db basics
 
No More SQL
No More SQLNo More SQL
No More SQL
 
Mongodb
MongodbMongodb
Mongodb
 
Kalp Corporate MongoDB Tutorials
Kalp Corporate MongoDB TutorialsKalp Corporate MongoDB Tutorials
Kalp Corporate MongoDB Tutorials
 
Mongodb Training Tutorial in Bangalore
Mongodb Training Tutorial in BangaloreMongodb Training Tutorial in Bangalore
Mongodb Training Tutorial in Bangalore
 
nosql [Autosaved].pptx
nosql [Autosaved].pptxnosql [Autosaved].pptx
nosql [Autosaved].pptx
 

More from GDSC UofT Mississauga

ICCIT Council × GDSC: UX / UI and Figma
ICCIT Council × GDSC: UX / UI and FigmaICCIT Council × GDSC: UX / UI and Figma
ICCIT Council × GDSC: UX / UI and FigmaGDSC UofT Mississauga
 
Community Projects Info Session Fall 2023
Community Projects Info Session Fall 2023Community Projects Info Session Fall 2023
Community Projects Info Session Fall 2023GDSC UofT Mississauga
 
MCSS × GDSC: Intro to Cybersecurity Workshop
MCSS × GDSC: Intro to Cybersecurity WorkshopMCSS × GDSC: Intro to Cybersecurity Workshop
MCSS × GDSC: Intro to Cybersecurity WorkshopGDSC UofT Mississauga
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]GDSC UofT Mississauga
 

More from GDSC UofT Mississauga (20)

CSSC ML Workshop
CSSC ML WorkshopCSSC ML Workshop
CSSC ML Workshop
 
ICCIT Council × GDSC: UX / UI and Figma
ICCIT Council × GDSC: UX / UI and FigmaICCIT Council × GDSC: UX / UI and Figma
ICCIT Council × GDSC: UX / UI and Figma
 
Community Projects Info Session Fall 2023
Community Projects Info Session Fall 2023Community Projects Info Session Fall 2023
Community Projects Info Session Fall 2023
 
GDSC x Deerhacks - Origami Workshop
GDSC x Deerhacks - Origami WorkshopGDSC x Deerhacks - Origami Workshop
GDSC x Deerhacks - Origami Workshop
 
Reverse Engineering 101
Reverse Engineering 101Reverse Engineering 101
Reverse Engineering 101
 
Michael's OWASP Juice Shop Workshop
Michael's OWASP Juice Shop WorkshopMichael's OWASP Juice Shop Workshop
Michael's OWASP Juice Shop Workshop
 
MCSS × GDSC: Intro to Cybersecurity Workshop
MCSS × GDSC: Intro to Cybersecurity WorkshopMCSS × GDSC: Intro to Cybersecurity Workshop
MCSS × GDSC: Intro to Cybersecurity Workshop
 
Basics of C
Basics of CBasics of C
Basics of C
 
Discord Bot Workshop Slides
Discord Bot Workshop SlidesDiscord Bot Workshop Slides
Discord Bot Workshop Slides
 
Web Scraping Workshop
Web Scraping WorkshopWeb Scraping Workshop
Web Scraping Workshop
 
Devops Workshop
Devops WorkshopDevops Workshop
Devops Workshop
 
Express
ExpressExpress
Express
 
HTML_CSS_JS Workshop
HTML_CSS_JS WorkshopHTML_CSS_JS Workshop
HTML_CSS_JS Workshop
 
DevOps Workshop Part 1
DevOps Workshop Part 1DevOps Workshop Part 1
DevOps Workshop Part 1
 
Docker workshop GDSC_CSSC
Docker workshop GDSC_CSSCDocker workshop GDSC_CSSC
Docker workshop GDSC_CSSC
 
Back-end (Flask_AWS)
Back-end (Flask_AWS)Back-end (Flask_AWS)
Back-end (Flask_AWS)
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
 
Git Init (Introduction to Git)
Git Init (Introduction to Git)Git Init (Introduction to Git)
Git Init (Introduction to Git)
 
ChatGPT General Meeting
ChatGPT General MeetingChatGPT General Meeting
ChatGPT General Meeting
 
Elon & Twitter General Meeting
Elon & Twitter General MeetingElon & Twitter General Meeting
Elon & Twitter General Meeting
 

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
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
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
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
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
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
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
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
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
 
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
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

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
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
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
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
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
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
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
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
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
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
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...
 
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
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

Database Workshop Slides

  • 2. Database Workshop Ido Ben Haim Daniyal Bokhari Discover the power of MongoDB: A beginner-friendly workshop
  • 3. ● Organized collection of information and data stored electronically ● Typically set up for efficient access and modification of the data ● Databases typically communicate with the application’s backend to store/get information which is then sent to the user What are Databases? Clients Backend/ REST API Database
  • 4. TL;DR: because speeeeeed Why not store everything in files? • Storing data in files can become messy and difficult to manage with large amounts of information • Databases make it more efficient to access information and filter results • Data can be stored in a structured way making it easier to manage and scale
  • 5. ● The JSON format is a way to store data in a key value manner. ● MongoDB uses the JSON format to store information in the form of documents (you’ll learn more about those later). P.S JSON stands for JavaScript Object Notation The JSON format
  • 6. // example JSON file { “username”: “cooluser123”, “password”: “TooC00lTOGu3ss”, “friends”: [“friendlyuser321”, “otheruser123”] }
  • 7. What’s the difference? SQL vs NoSQL DBs • SQL databases store data in tables containing columns and rows, tables can be related to one another using keys, relational database management system (RDBMS) • SQL databases are useful when data is organized and structured in specific ways • SQL databases use Structured Query Language in order to access and manage data
  • 8. What’s the difference? SQL vs NoSQL DBs • NoSQL databases store data in documents (JSON, BSON, etc), key-value storage, column-oriented storage, graph-databases • NoSQL databases are useful for data that is unstructured, documents in the database can have different structures • Have dynamic schemas Graph Database
  • 9. In short; a database server ● MongoDB is a NoSQL database service which lets developers store data in a flexible manner. ● MongoDB is free to use for anyone in the world ● MongoDB has gained popularity in recent years due to its ease of use, scalability, and performance. ● MongoDB can be used in a wide range of applications, including web applications, content management systems, mobile apps, and more. What is MongoDB
  • 10. MongoDB VS MySQL When to use which? MongoDB’s document layout allows you to store data which might not exist in documents within the same collection. MySQL’s rigid data structures enforce uniformity and is less error-prone. MongoDB allows you to index large documents, making it faster to search them MySQL allows for storing data with complex relationships between one another (e.g friends on facebook)
  • 11. MongoDB Basics • MongoDB databases contain collections of documents • Collections store documents, which can each have different schemas • Data is stored in BSON documents, a binary representation of JSON documents • Documents store data in field-value pairs, each field-value pair has a unique ID Databases, collections, and documents Database Collection Collection Collection Document Document Document Document Document Document Document Document Document
  • 12. Getting started with MongoDB Atlas ● MongoDB Atlas is a platform that allows you to host a MongoDB server for free (with some limitations) ● To get started go to https://www.mongodb.com/atlas/ ● Click “Try Free” Its as simple as opening an account!
  • 13. Getting started with MongoDB Atlas ● Sign Up by filling out the signup form ● Leave the company field blank, it is optional Its as simple as opening an account!
  • 14. Getting started with MongoDB Atlas ● Verify your email address ● After verifying your email address, you’ll be prompted to deploy a database, just select the free option and give it a fitting name ● We’ll name it “demo” Its as simple as opening an account!
  • 15. Getting started with MongoDB Atlas ● Once you have your database finish setting it up by making a database user Its as simple as opening an account!
  • 16. Getting started with MongoDB Atlas ● Make sure you allow access from anywhere by adding 0.0.0.0 as an allowed ip address Its as simple as opening an account!
  • 17. Getting started with MongoDB Atlas Its as simple as opening an account!
  • 18. Connecting to your database ● Press on the “connect” button beside your demo deployment ● Press “connect to your application” > Set the driver to Python and choose your version > copy the connection string step-by-step
  • 19. Connecting to your database ● Open up the demo .py file shared to the chat ● In your terminal (VS Code terminal, Pycharm Terminal, command prompt) run the command pip install pymongo (make sure you have pip already installed) Step-by-step
  • 20. Connecting to your database ● Create a connection to your database using MongoClient and the connection string you copied ○ Change the <password> field to the password you set for your database user ● On MacOS, you may need to include an additional argument, a certification to connect step-by-step client = MongoClient('<connection string>') client = MongoClient('<connection string>', tlsCAFile=certifi.where())