SlideShare a Scribd company logo
[Open Source Programming] Data Store – NoSQL with Python: Getting Started
Open Source Programming
Data Store – NoSQL with Python: Getting Started
[Open Source Programming] Data Store – NoSQL with Python: Getting Started
Various Storage Types – e.g., Azure Cloud
[Open Source Programming] Data Store – NoSQL with Python: Getting Started
NoSQL – type and examples
• non-SQL / non-relational approach / Not only SQL
Source: https://en.wikipedia.org/wiki/NoSQL
[Open Source Programming] Data Store – NoSQL with Python: Getting Started
NoSQL with open sources – e.g., MEAN stack
• M: MongoDB
• E: Express.js
• A: AngularJS
• N: Node.js
• Why NoSQL in MEAN Stack?
• For programs that use JSON-
like BSON (binary JSON)
documents with schema
• MongoDB supports its use of
JSON-like documents for
interacting with data as
opposed to the row/column
model
Source: https://en.wikipedia.org/wiki/MEAN_(solution_stack)
[Open Source Programming] Data Store – NoSQL with Python: Getting Started
• Environment: Ubuntu 20.04 LTS with Python 3
• Example 1: DB Connection test with pymongo
• Example 2: CRUD with MongoDB & Python
Using NoSQL (MongoDB) with Python
[Open Source Programming] Data Store – NoSQL with Python: Getting Started
• Install MongoDB on Ubuntu 20.04 LTS:
Using MongoDB with Python: 1. Install MongoDB
$ sudo apt install -y mongodb
$ sudo systemctl status mongodb
$ mongod --version
Output
db version v3.6.8
git version: 8e540c0b6db93ce994cc548f000900bdc740f80a
OpenSSL version: OpenSSL 1.1.1f 31 Mar 2020
allocator: tcmalloc
modules: none
build environment:
distarch: x86_64
target_arch: x86_64
https://aka.ms/mongodb-install-on-ubuntu
[Open Source Programming] Data Store – NoSQL with Python: Getting Started
• Sample MongoDB connection test:
Using MongoDB with Python: 2. Connection
$ mongo --host 127.0.0.1:27017
> use admin;
switched to db admin
> db.createUser( { user: "administrator", pwd: "Pa55w.rd", roles: [ { role:
"userAdminAnyDatabase", db: "admin" }, { role: "clusterMonitor", db:"admin" },
"readWriteAnyDatabase" ] } );
Output
Successfully added user: {
"user" : "administrator",
"roles" : [
{
"role" : "userAdminAnyDatabase",
"db" : "admin"
},
{
"role" : "clusterMonitor",
"db" : "admin"
},
"readWriteAnyDatabase"
]
}
> exit;
https://aka.ms/mongodb-from-azure-cosmosdb
Successfully added user: {
"user" : "administrator",
"roles" : [
{
"role" : "userAdminAnyDatabase",
"db" : "admin"
},
{
"role" : "clusterMonitor",
"db" : "admin"
},
"readWriteAnyDatabase"
]
}
[Open Source Programming] Data Store – NoSQL with Python: Getting Started
• Sample MongoDB connection test:
Using MongoDB with Python: 3. New User
$ mongo admin -u "administrator" -p "Pa55w.rd" --host 127.0.0.1:27017
> use DeviceData;
switched to db DeviceData
> db.createUser(
{
user: "deviceadmin",
pwd: "Pa55w.rd",
roles: [ { role: "readWrite", db: "DeviceData" } ]
}
);
Output
Successfully added user: {
"user" : "deviceadmin",
"roles" : [
{
"role" : "readWrite",
"db" : "DeviceData"
}
]
}
> exit;
https://aka.ms/mongodb-from-azure-cosmosdb
Successfully added user: {
"user" : "deviceadmin",
"roles" : [
{
"role" : "readWrite",
"db" : "DeviceData"
}
]
}
[Open Source Programming] Data Store – NoSQL with Python: Getting Started
• mongodb://administrator:Pa55w.rd@localhost:27017/?authSource=admin
Using MongoDB with Python: 4. Connection Test
# GitHub Gist on https://bit.ly/mongodb-python-connection-test-sample
$ wget -O mongodb-connection-test.py https://bit.ly/mongodb-python-connection-test-sample-raw
$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install pymongo
$ python mongodb-connection-test.py
Enter your primary connection string:
mongodb://administrator:Pa55w.rd@localhost:27017/?authSource=admin
Output
{'allocator': 'tcmalloc',
'bits': 64,
'buildEnvironment': {'cc': 'cc: cc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0',
'ccflags': '-fno-omit-frame-pointer -fno-strict-aliasing '
'-ggdb -pthread -Wall -Wsign-compare ‘
…
https://bit.ly/mongodb-python-connection-test-sample
[Open Source Programming] Data Store – NoSQL with Python: Getting Started
• CRUD: Create, Retrieve, Update, and Delete
Using MongoDB with Python: 5. CRUD w/ Flask
$ git clone https://github.com/ianychoi/flask-mongodb.git
$ cd flask-mongodb
$ deactivate # if you were using another virtual environment
$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install -r requirements.txt
$ flask run --host=0.0.0.0 --port=8080
Enter your primary connection string:
mongodb://administrator:Pa55w.rd@localhost:27017/?authSource=admin
Output (example of an Azure Linux VM: 8080 port has been open through Azure Portal)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
Enter your primary connection string:
* Running on all addresses (0.0.0.0)
WARNING: This is a development server. Do not use it in a production deployment.
* Running on http://127.0.0.1:8080
* Running on http://10.1.0.4:8080 (Press CTRL+C to quit)
https://github.com/ianychoi/flask-mongodb
[Open Source Programming] Data Store – NoSQL with Python: Getting Started
Finished!

More Related Content

PPTX
Dev Jumpstart: Building Your First App
PDF
MongoDB and Node.js
PDF
Running MongoDB Enterprise on Kubernetes
PDF
Back to Basics 2017: Mí primera aplicación MongoDB
PDF
Parse cloud code
PPTX
Webinar: Building Your First App in Node.js
PPTX
Webinar: Building Your First App in Node.js
PPTX
Building Your First App with Shawn Mcarthy
Dev Jumpstart: Building Your First App
MongoDB and Node.js
Running MongoDB Enterprise on Kubernetes
Back to Basics 2017: Mí primera aplicación MongoDB
Parse cloud code
Webinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.js
Building Your First App with Shawn Mcarthy

Similar to 오픈 소스 프로그래밍 - NoSQL with Python (20)

PPTX
Back to Basics Webinar 2: Your First MongoDB Application
PPTX
Back to Basics Webinar 2 - Your First MongoDB Application
PPTX
Dev Jumpstart: Build Your First App with MongoDB
PPTX
Back to Basics, webinar 2: La tua prima applicazione MongoDB
PDF
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...
PPTX
Dev Jumpstart: Build Your First App with MongoDB
PPTX
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...
PDF
NoSQL on microsoft azure april 2014
PDF
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
PDF
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
PPTX
PPTX
Dev Jumpstart: Build Your First App with MongoDB
KEY
Practical Use of MongoDB for Node.js
PDF
Best Practices for Effectively Running dbt in Airflow
PPTX
Get expertise with mongo db
PPTX
ROS Tutorials with examples for beginners.pptx
PPTX
SH 1 - SES 4 - Microservices - Andrew Morgan TLV.pptx
PPTX
Deploying windows containers with kubernetes
PDF
EuroPython 2013 - FAST, DOCUMENTED AND RELIABLE JSON BASED WEBSERVICES WITH P...
PDF
RESTful OSGi middleware for NoSQL databases with Docker
Back to Basics Webinar 2: Your First MongoDB Application
Back to Basics Webinar 2 - Your First MongoDB Application
Dev Jumpstart: Build Your First App with MongoDB
Back to Basics, webinar 2: La tua prima applicazione MongoDB
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...
Dev Jumpstart: Build Your First App with MongoDB
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...
NoSQL on microsoft azure april 2014
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Dev Jumpstart: Build Your First App with MongoDB
Practical Use of MongoDB for Node.js
Best Practices for Effectively Running dbt in Airflow
Get expertise with mongo db
ROS Tutorials with examples for beginners.pptx
SH 1 - SES 4 - Microservices - Andrew Morgan TLV.pptx
Deploying windows containers with kubernetes
EuroPython 2013 - FAST, DOCUMENTED AND RELIABLE JSON BASED WEBSERVICES WITH P...
RESTful OSGi middleware for NoSQL databases with Docker
Ad

More from Ian Choi (20)

PDF
Ship it! ⛴️ AKS에 스프링 앱 배포하기 at Microsoft x GitHub Roadshow 2023
PDF
클라우드 컴퓨팅 기본 사항 (Fundamentals)
PDF
디자인에 이어 코딩까지 AI가 프로그램 개발을 척척?: GitHub Copilot, 어디까지 알아보셨나요
PDF
마이크로소프트 애저 및 클라우드 트렌드 소개 (부제: Beyond IaaS)
PDF
Evolving Translation and Internationalization in OpenStack & Kubernetes commu...
PDF
쿠버네티스 오픈 소스와 클라우드 매니지드 서비스 접점 소개
PDF
Azure 클라우드 학생 계정 & Ubuntu VM 셋업 (Mar 2022)
PDF
OpenStack I18n Product Update at Shanghai: how OpenStack translation started ...
PDF
[OpenInfra Days Vietnam 2019] Innovation with open sources and app modernizat...
PDF
Microsoft loves communities - Korea DevRel Team
PDF
DevOps와 함께 살펴보는 (해커톤의 성패를 좌우하는) 협업/개발 툴
PDF
국제화/번역과 함께 하는 오픈소스에 대한 경험 및 노하우
PDF
[201808] GitHub 사용하기 - GIt & 협업 활용
PDF
[OpenStack] 공개 소프트웨어 오픈스택 입문 & 파헤치기
PDF
[2018 KOSSLAB 컨트리뷰톤] 오픈스택 (OpenStack) 프로젝트 소개 + 업스트림 컨트리뷰션
PDF
[2018 공개SW그랜드챌린지] 오픈 인프라와 오픈 커뮤니티에서의 협력
PDF
OpenStack 2018 Vancouver Summit 후기
PDF
"docs.microsoft.com"에 기여하기
PDF
[Pycon KR 2017] Rst와 함께하는 Python 문서 작성 & OpenStack 문서 활용 사례
PDF
명령 프롬프트, Azure CLI 2.0은 과연 코딩일까?
Ship it! ⛴️ AKS에 스프링 앱 배포하기 at Microsoft x GitHub Roadshow 2023
클라우드 컴퓨팅 기본 사항 (Fundamentals)
디자인에 이어 코딩까지 AI가 프로그램 개발을 척척?: GitHub Copilot, 어디까지 알아보셨나요
마이크로소프트 애저 및 클라우드 트렌드 소개 (부제: Beyond IaaS)
Evolving Translation and Internationalization in OpenStack & Kubernetes commu...
쿠버네티스 오픈 소스와 클라우드 매니지드 서비스 접점 소개
Azure 클라우드 학생 계정 & Ubuntu VM 셋업 (Mar 2022)
OpenStack I18n Product Update at Shanghai: how OpenStack translation started ...
[OpenInfra Days Vietnam 2019] Innovation with open sources and app modernizat...
Microsoft loves communities - Korea DevRel Team
DevOps와 함께 살펴보는 (해커톤의 성패를 좌우하는) 협업/개발 툴
국제화/번역과 함께 하는 오픈소스에 대한 경험 및 노하우
[201808] GitHub 사용하기 - GIt & 협업 활용
[OpenStack] 공개 소프트웨어 오픈스택 입문 & 파헤치기
[2018 KOSSLAB 컨트리뷰톤] 오픈스택 (OpenStack) 프로젝트 소개 + 업스트림 컨트리뷰션
[2018 공개SW그랜드챌린지] 오픈 인프라와 오픈 커뮤니티에서의 협력
OpenStack 2018 Vancouver Summit 후기
"docs.microsoft.com"에 기여하기
[Pycon KR 2017] Rst와 함께하는 Python 문서 작성 & OpenStack 문서 활용 사례
명령 프롬프트, Azure CLI 2.0은 과연 코딩일까?
Ad

Recently uploaded (20)

PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
ai tools demonstartion for schools and inter college
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
history of c programming in notes for students .pptx
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
Introduction to Artificial Intelligence
PDF
System and Network Administraation Chapter 3
PPTX
Transform Your Business with a Software ERP System
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
Reimagine Home Health with the Power of Agentic AI​
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
How to Choose the Right IT Partner for Your Business in Malaysia
Wondershare Filmora 15 Crack With Activation Key [2025
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
ai tools demonstartion for schools and inter college
Upgrade and Innovation Strategies for SAP ERP Customers
history of c programming in notes for students .pptx
Operating system designcfffgfgggggggvggggggggg
How Creative Agencies Leverage Project Management Software.pdf
PTS Company Brochure 2025 (1).pdf.......
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Introduction to Artificial Intelligence
System and Network Administraation Chapter 3
Transform Your Business with a Software ERP System
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Reimagine Home Health with the Power of Agentic AI​

오픈 소스 프로그래밍 - NoSQL with Python

  • 1. [Open Source Programming] Data Store – NoSQL with Python: Getting Started Open Source Programming Data Store – NoSQL with Python: Getting Started
  • 2. [Open Source Programming] Data Store – NoSQL with Python: Getting Started Various Storage Types – e.g., Azure Cloud
  • 3. [Open Source Programming] Data Store – NoSQL with Python: Getting Started NoSQL – type and examples • non-SQL / non-relational approach / Not only SQL Source: https://en.wikipedia.org/wiki/NoSQL
  • 4. [Open Source Programming] Data Store – NoSQL with Python: Getting Started NoSQL with open sources – e.g., MEAN stack • M: MongoDB • E: Express.js • A: AngularJS • N: Node.js • Why NoSQL in MEAN Stack? • For programs that use JSON- like BSON (binary JSON) documents with schema • MongoDB supports its use of JSON-like documents for interacting with data as opposed to the row/column model Source: https://en.wikipedia.org/wiki/MEAN_(solution_stack)
  • 5. [Open Source Programming] Data Store – NoSQL with Python: Getting Started • Environment: Ubuntu 20.04 LTS with Python 3 • Example 1: DB Connection test with pymongo • Example 2: CRUD with MongoDB & Python Using NoSQL (MongoDB) with Python
  • 6. [Open Source Programming] Data Store – NoSQL with Python: Getting Started • Install MongoDB on Ubuntu 20.04 LTS: Using MongoDB with Python: 1. Install MongoDB $ sudo apt install -y mongodb $ sudo systemctl status mongodb $ mongod --version Output db version v3.6.8 git version: 8e540c0b6db93ce994cc548f000900bdc740f80a OpenSSL version: OpenSSL 1.1.1f 31 Mar 2020 allocator: tcmalloc modules: none build environment: distarch: x86_64 target_arch: x86_64 https://aka.ms/mongodb-install-on-ubuntu
  • 7. [Open Source Programming] Data Store – NoSQL with Python: Getting Started • Sample MongoDB connection test: Using MongoDB with Python: 2. Connection $ mongo --host 127.0.0.1:27017 > use admin; switched to db admin > db.createUser( { user: "administrator", pwd: "Pa55w.rd", roles: [ { role: "userAdminAnyDatabase", db: "admin" }, { role: "clusterMonitor", db:"admin" }, "readWriteAnyDatabase" ] } ); Output Successfully added user: { "user" : "administrator", "roles" : [ { "role" : "userAdminAnyDatabase", "db" : "admin" }, { "role" : "clusterMonitor", "db" : "admin" }, "readWriteAnyDatabase" ] } > exit; https://aka.ms/mongodb-from-azure-cosmosdb Successfully added user: { "user" : "administrator", "roles" : [ { "role" : "userAdminAnyDatabase", "db" : "admin" }, { "role" : "clusterMonitor", "db" : "admin" }, "readWriteAnyDatabase" ] }
  • 8. [Open Source Programming] Data Store – NoSQL with Python: Getting Started • Sample MongoDB connection test: Using MongoDB with Python: 3. New User $ mongo admin -u "administrator" -p "Pa55w.rd" --host 127.0.0.1:27017 > use DeviceData; switched to db DeviceData > db.createUser( { user: "deviceadmin", pwd: "Pa55w.rd", roles: [ { role: "readWrite", db: "DeviceData" } ] } ); Output Successfully added user: { "user" : "deviceadmin", "roles" : [ { "role" : "readWrite", "db" : "DeviceData" } ] } > exit; https://aka.ms/mongodb-from-azure-cosmosdb Successfully added user: { "user" : "deviceadmin", "roles" : [ { "role" : "readWrite", "db" : "DeviceData" } ] }
  • 9. [Open Source Programming] Data Store – NoSQL with Python: Getting Started • mongodb://administrator:Pa55w.rd@localhost:27017/?authSource=admin Using MongoDB with Python: 4. Connection Test # GitHub Gist on https://bit.ly/mongodb-python-connection-test-sample $ wget -O mongodb-connection-test.py https://bit.ly/mongodb-python-connection-test-sample-raw $ python3 -m venv .venv $ source .venv/bin/activate $ pip install pymongo $ python mongodb-connection-test.py Enter your primary connection string: mongodb://administrator:Pa55w.rd@localhost:27017/?authSource=admin Output {'allocator': 'tcmalloc', 'bits': 64, 'buildEnvironment': {'cc': 'cc: cc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0', 'ccflags': '-fno-omit-frame-pointer -fno-strict-aliasing ' '-ggdb -pthread -Wall -Wsign-compare ‘ … https://bit.ly/mongodb-python-connection-test-sample
  • 10. [Open Source Programming] Data Store – NoSQL with Python: Getting Started • CRUD: Create, Retrieve, Update, and Delete Using MongoDB with Python: 5. CRUD w/ Flask $ git clone https://github.com/ianychoi/flask-mongodb.git $ cd flask-mongodb $ deactivate # if you were using another virtual environment $ python3 -m venv .venv $ source .venv/bin/activate $ pip install -r requirements.txt $ flask run --host=0.0.0.0 --port=8080 Enter your primary connection string: mongodb://administrator:Pa55w.rd@localhost:27017/?authSource=admin Output (example of an Azure Linux VM: 8080 port has been open through Azure Portal) * Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Debug mode: off Enter your primary connection string: * Running on all addresses (0.0.0.0) WARNING: This is a development server. Do not use it in a production deployment. * Running on http://127.0.0.1:8080 * Running on http://10.1.0.4:8080 (Press CTRL+C to quit) https://github.com/ianychoi/flask-mongodb
  • 11. [Open Source Programming] Data Store – NoSQL with Python: Getting Started Finished!