1. RDBMS vs NoSQL
Rdbms
-Highly organized structured data
-Structured Query Language (SQL) (SQL)
-Data and relationships are stored in separate tables.
-Data manipulation language, data definition language
-Strict consistency
-Basic services
Nosql
-represents more than just SQL
-No declarative query language
-No pre-defined pattern
-key-value pair storage, column storage, document storage, graphics database
-final consistency, not ACID properties
-Unstructured and unpredictable data
-Cap theorem
-High performance, high availability and scalability
2. Mangodb contrast
3. MongoDB installation Process
cd/usr/local/data/
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1404-3.2.4.tgz
-mongodb-linux-x86_64-ubuntu1404-3.2.4.tgz
Build Folder
MongoDB DATA:
sudo mkdir-p /data/db/mongodb
MongoDB LOG:
sudo mkdir-p /data/log/mongodb
The
first method of booting:
MONGO Server Startup:Sudo/usr/local/data/mongodb-linux-x86_64-ubuntu1404-3.2.4/bin/mongod--dbpath/data/db/mongodb/--logpath/data/ Log/mongodb/mongodb.log--logappend &
MONGO Server
Close:Sudo/usr/local/data/mongodb-linux-x86_64-ubuntu1404-3.2.4/bin/mongod--dbpath/data/db/mongodb/--logpath/data/ Log/mongodb/mongodb.log--logappend--shutdown
The second method of booting:
Increase mongod.confNote: Conforms to Yalm notation, 4 spaces Non-tab
SystemLog:destination:file path:/data/log/mongodb/mongodb.log logAppend:truestorage:dbPath:/data/db/mong ODB journal:enabled:trueprocessmanagement:fork:truenet:bindip:127.0.0.1 port:27017
MONGO Server Startup:
Sudosh/usr/local/data/mongodb-linux-x86_64-ubuntu1404-3.2.4/bin/mongod--config/usr/local/data/mongodb-linux-x86_64-ubuntu1404-3.2.4/mongod.conf
MONGO Server
Close:
Sudosh/usr/local/data/mongodb-linux-x86_64-ubuntu1404-3.2.4/bin/mongod--config/usr/local/data/mongodb-linux-x86_64-ubuntu1404-3.2.4/mongod.conf--shutdown
MONGO client Startup:sudo sh/usr/local/data/mongodb-linux-x86_64-ubuntu1404-3.2.4/Bin/mongo
4.terminology corresponding to the RDBMS and MongoDB:
Reference: Http://www.runoob.com/mongodb
5.mongoDB Add user when security is not turned on
Use admin
Db.createuser ({User: "Malianghang", pwd: "malianghang123", roles: [{role: "Useradminanydatabase", DB: "admin " } ] })
6. mongodb.conf on (red part)
SystemLog:destination:file path:/data/log/mongodb/mongodb.log logAppend:truestorage:dbPath:/data/db/mong ODB journal:enabled:trueprocessmanagement:fork:truenet:bindip:127.0.0.1 port:27017security:a Uthorization:enabled
Turn off Mongod first, then start up: sudo sh/usr/local/data/mongodb-linux-x86_64-ubuntu1404-3.2.4/bin/mongod--config/usr/local/data/ mongodb-linux-x86_64-ubuntu1404-3.2.4/mongod.conf off: sudo sh/usr/local/data/mongodb-linux-x86_64- Ubuntu1404-3.2.4/bin/mongod--config/usr/local/data/mongodb-linux-x86_64-ubuntu1404-3.2.4/mongod.conf--shutdown
7. Start MONGO client
Sh/usr/local/data/mongodb-linux-x86_64-ubuntu1404-3.2.4/bin/mongo--host 127.0.0.1--port 27017-u "Malianghang"-P " Malianghang123 "--authenticationdatabase" admin "
Switch to the database you want use Mlh_dev
Create user in Mlh_dev: Db.createuser ({User: "Mlhtest", pwd: "malianghang123", Roles: ["ReadWrite", "DbAdmin"]})
8. MongoDB GUI recommends using Robomongo
Https://robomongo.org/download
From for notes (Wiz)
MANGODB installation Process