NoSQL (2)
MongoDB Package Components
🐤 MongoDBの3つのコアプロセス🐤
1) mongod
mongod is the primary daemon process for the MongoDB system. It handles data requests, manages data access, and performs background management operations.
This document provides a complete overview of all command line options for mongod. These command line options are primarily useful for testing: In common operation, use the configuration file options to control the behavior of your database.
mongodはMongoDBシステムのデフォルトのデーモンプロセスです.
データ要求を処理し、データアクセスを管理し、バックグラウンド管理タスクを実行します.
configファイルを使用してデータベースの動作を制御します.
2) mongos
For a sharded cluster, the mongos instances provide the interface between the client applications and the sharded cluster. The mongos instances route queries and write operations to the shards. From the perspective of the application, a mongos instance behaves identically to any other MongoDB instance.
Documentはmongos instanceと解釈しますが、それをShaddingノード(マシン)と見なせば簡単です.
シールドされたクラスタの場合、mongosインスタンスはクライアントアプリケーションとシールドされたクラスタとの間のインタフェースを提供します.
mongosインスタンスは、クエリーと書き込み操作をグリッドにルーティングします.
アプリケーションの観点からmongosインスタンスは他のMongoDBインスタンスと同じ働き方です!
샤딩
なに?샤딩
表示데이터를 여러 서버에 분산해서 저장하고 처리할 수 있는 기술
レプリケーションとは異なり、レプリケーションは高可用性ソリューション、샤딩은 분산처리를 위한 솔루션
!( 몽고디비에서는 고가용성과 대용량 분산 처리를 위해 복제+샤딩 모두 사용!
) 몽고디비에서는 샤딩을 통해 수평확장을 지원
3) mongosh
The MongoDB Shell, mongosh, is a fully functional JavaScript and Node.js 14.x REPL environment for interacting with MongoDB deployments. You can use the MongoDB Shell to test queries and operations directly with your database.
MongoshはMongoDB Shellであり、MongoDBデプロイメントとインタラクティブなすべての機能を備えています.js 14.x REPL環境.
MongoDB Shellを使用して、データベース内で直接クエリーおよび操作を行います.
🐤 SQL vs MongoDB 🐤
SQLで使われている概念と用語、MongoDBで使われている用語と概念は似ていて非常に違います!片付けましょうか...?🥝
db.collection.insertOne()
db.collection.insertMany()
# 여기서 collection은 테이블을 뜻하고, 기존에 있는 table이라면 거기에 값이 들어가고 없는 table이라면 새로 생성되어서 들어감!
# 신기한게 하나만 넣는 명령어가 따로, 여러개 넣는 명령어가 따로임!
2) read->findという名前の関数による操作
db.collection.find()
ex)
db.mango.insertOne({x:'starbucks'})
db.mango.find({x:'starbucks'}) # 이건 특정 값 조회
db.mango.find({}) # 이건 전체 조회
# 해당 값이 없으면 아무것도 리턴 안함
selectupdate
delete
注1:https://docs.mongodb.com/manual/reference/program/mongod/#mongodb-binary-bin.mongod
注2:https://junghwanta.tistory.com/30?category=857330
Reference
この問題について(NoSQL (2)), 我々は、より多くの情報をここで見つけました https://velog.io/@majaeh43/NoSQL-2-h27ypzfmテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol