MONGDB Database Knowledge 1
program = data structure + algorithm
Data storage Phase
1, File Management phase (. txt. doc. xls)
Advantages: Data can be stored for a long time, can store a large amount of data, easy to use
Disadvantage: Data consistency is poor, data lookup modification is inconvenient, data redundancy is large
2, Database storage phase
Advantages: Data organization structure, reduce redundancy, convenient extension, convenient program call, do automated processing
Cons: Database usage often requires specific statements or commands to operate, relatively complex
Several concepts
Data: A collection of information that can be entered into a computer and processed;
Data structure: The study of a data set, the relationship between the disciplines;
Database: A warehouse that stores management data according to the data structure. Database is a collection of data on a certain medium under the management and control of the database management system.
Database management system: Database management software for the establishment of maintenance database;
Database system: A collection of development tools, such as database and database management system;
relational database
Database using relational model to organize data structures (two-dimensional table)
Oracle DB2 SQL Server MySQL SqLite
Advantages: (1) Easy to understand, logic similar to common forms
(2) Easy to use, all use SQL statements, SQL statements very mature
(3) Data consistency is high, redundancy is low, integrity is good
(4) Mature technology, can use external links and other complex operations
Disadvantages: (1) each time the SQL statement is required to parse, consume a large
(2) can not well meet the concurrency requirements, especially the outbreak of massive data, relational database general reading and writing ability is insufficient
(3) Each step inside the relational database should be locked to ensure the atomicity of the operation and increase the burden of the database.
(4) Data consistency can sometimes lead to a lot of wasted space
Database paradigm:
Https://baike.baidu.com/item/%E6%95%B0%E6%8D%AE%E5%BA%93%E8%8C%83%E5%BC%8F/7309898?fr=aladdin
Non-relational database (NOSQL-not-only SQL)
Advantages: (1) high concurrency, strong reading and writing ability;
(2) Generally more easily extended than relational databases
(3) Weaken the data structure and reduce the consistency
Cons: (1) Poor versatility, no consistent operation with SQL
(2) Flexible operation, easy to confuse;
(3) There are no operations such as join, and some databases do not support operations like transactions in relational databases. Version update fast;
The use of NoSQL:
1. Low Data consistency requirements
2. Database processing of massive concurrent storage
3. Database size is not easy to estimate, need to distribute the extension
4. A nosql model is easier to set up for a given data
Categories of NoSQL:
(1) Key-valued Database: Redis Oracle BDB Tokyo
(2) Columnstore database: Hbase
(3) Document-based database: MongoDB
(4) Graphics database:
MongoDB Database (non-relational database---> Document type Database)
1. Database management system prepared by C + +;
2. Support a wealth of additions and deletions to check the operation;
3. Support for rich data types;
4. Support for numerous programming language interfaces (Python ruby PHP C # C #)
5. Easy to use and easy to deploy. In a non-relational database that belongs to a more mature database
MongoDB Installation
Automatic installation:
sudo apt-get install MongoDB
Cookies
Whereis Software Name: View Software location
Default installation location:/var/lib/mongodb
Configuration file Location:/etc/mongodb.conf
Command set:/usr/bin/usr/local/bin
Manual Installation:
1. Download MongoDB (open source)
www.mongodb.com--->get mongodb-->community server
Choose the version you want to download
2. Select the appropriate location to extract (/usr/local/opt)
Get the MongoDB folder after tar decompression
3. Change the Bin folder in the MongoDB folder to an environment variable
Path= $PATH:/opt/mongo..../bin
Export PATH
Write the above two sentences to/etc/rc.local
4. Rebooting the system
Mongdb, chapter I: Database Knowledge 1