I. Definition
high-performance, open source, modeless document-type NoSQL database
Note: 1, the file storage format is Bson (a JSON extension, 2-in-system expression, high efficiency)
2. Free mode: No table structure
3, support dynamic query: Conditional query, paging query and statistical inquiry
4, support full index: have general index and full index
5. Support for replication and failure recovery
Example: {"Hello": "World"}---------->{"\x16\x00\x00\x00\x02hello\xoo", "\x06\x00\x00\x00world\x00\x00"}
6, the use of efficient binary data storage, including large objects (video)
7, automatic processing of debris to support the scalability of the computational hierarchy
8, Support Java, Ruby, python,c++ and other languages
9. Support JavaScript
Second, advantages
1. Fast query speed
2, high concurrency, about 20,000; Oracle Enterprise Edition concurrency number, single node is 5,000
3, high capacity of more than 10TB
Third, MongoDB applicable scene
1, the website data------> Inserts the update in real time
2, Cache--------"such as Redis
3, large size, low value of data
4, highly scalable scene--------"hundreds of server clusters
5, for objects and JSON data storage
such as: SourceForge-----------------> Open Source Hosting website
Iv. restrictions on the use of MongoDB
2.5G data storage is not supported on 1, 32-bit operating systems
2. Single File Size "=16m
3. Systems that do not support high things: such as banking systems or accounting systems, require a large number of atomic complex things
4, the traditional business intelligence application
v. Comparison with relational databases
1, Mongodb
Database, collection, document (one row of data in a table), Key (table field), no primary foreign key, flexible extension extremely high
2. Relational database (Oracle, MySQL)
databases, two-dimensional tables, a record (one row of data in a table), Columns (table fields), PK and FK (primary foreign key), flexibility spread difference
vi. installation of MongoDB
1, Download: www.mongodb.org
2, decompression download of the compressed package, renamed to MONGO
3, local disk to create a MongoDB folder for storing MONGO data files
4, start the service: Mongod.exe
Start client: Mongo.exe
Note: server-side for data storage, client access to data
5, set the statement:
D:\mongo\bin\mongod--dbpath=d:\db--logpath=f:\mongo\logs\mongodb.log--port=27017
Note: DBPath represents the MongoDB's data store address, LogPath represents the MongoDB's log file address, and port represents the number of ports visited.
Seven, mongo command parameter description
1, dbpath: Data file storage path, used to prevent the use of a power to run multiple Mongof.lock also saved in this directory
2, LogPath: Directory of log files
3, Logappend: Log file with the Append mode, the default is direct coverage mode
4, BIND_IP: External services of the binding IP, generally set to null and binding on all available IP on this machine
5, Port: External service port, Web management port on the basis of this port minus 1000
6, Fork:linux under the use, indicating the daemon form of the operation of the service
7, Journal: Open the Log function, used to restore the log
8, Syncdelay: The system synchronized Refresh Disk Time (default is 60s), and Redis similar
9, Directoryperdb: Each db stored in a separate directory, easy to maintain
10, Maxconns: Maximum number of connections
11, Repairpath: Restore the data mechanism, not commonly used. If to open journal, abnormal down machine after reboot must perform require operation