Transferred from:http://blog.dufei.cc/index.php/archives/25/
NoSQL has recently become a hot Topic (published by the authors in 2012, saying that for now, NoSQL is in full swing). The demand for highly scalable and semi-structured data in large-scale architecture Web services development drives the database toward NoSQL. There have been a number of NoSQL database solutions in recent years. I have been in the past blog (not my blog, author blog card) has introduced the theory based on distributed system NoSQL, but also introduced some good products, such as Couchdb and Cassandra/hbase.
In Friday, I was very fortunate to have seen the 10gen Jared Rosoff at a technical meeting. We have done some research on MongoDB's technical architecture, and I think we have a lot of value to talk about, so put it here and share it with everyone.
First, the ease of use of mongodb and the simplicity of the underlying architecture made me very surprised. Here are some simple administration commands--turning MongoDB server on and off.
- #安装MongoDB
- Mkdir/data/lib
- #开启 Server
- .../bin/mongod #这个时候数据就存储在了/data/db.
- #开启命令行shell
- ...../bin/mongo
- >show DBS
- >show Collections
- #删除collection (delete table)
- >db.person.drop ()
- #通过命令行shell关闭mongod Server
- >use Admin
- >db.shutdownserver ()
Translator Note: Actually start Mongod can be started with-F conf.txt This mode, the parameters of the launch into the conf.txt such as
The main differences with respect to relational databases
The main differences between MongoDB vs. relational database are as follows:
- The Tabular Data format (2-D data format) of different and relational databases, MongoDB tables (collection) can be nested and multidimensional. In other words, MongoDB tables can be nested inside the table, array, hash table and so on.
- Unlike the data that is stored in a table in a relational database, it has to be all-in-one format, and MongoDB collection can insert data in any format.
- The MongoDB query does not have a join operation. The task of encouraging non-stereotypical organizational data and maintaining data consistency is given to programmers.
- MongoDB has no thing (transaction) this says. Atomicity remains at the level of document (which can be understood as one line). In other words, it is not possible to update an incomplete case when updating a row.
- MongoDB is not isolated (isolation), and any data read by the client may have been modified by the client side in parallel.
By removing the features supported by these traditional relational databases, MongoDB can perform large data processing in a more lightweight and flexible form.
Query processing
MongoDB belongs to a document-oriented database. In the query processing module, the data is organized into a JSON document,nd ()
Translation MongoDB Architecture (MongoDB Architecture)