Know MongoDB [based on a distributed file storage database]

[Introduction]

1, is written by C ++ language. Designed to provide scalable, high-performance data storage solution for WEB applications.

2, MongoDB is a product with function between relational databases and non-relational databases, non-relational database functions among the richest and most like a relational database.

MongoDB .jpg

【effect】

1) Site real-time data processing. It is ideal for real-time insert, update and query, and have the site live data storage required for replication and highly scalable.

2) cache. Due to the high performance, it is suitable as a buffer layer information infrastructure. After system restart, the buffer layer can be avoided by the persistence of its underlying data source built overload.

3) scenes of high stretchability. Is ideal for database consists of tens or hundreds of servers, and its road map already contains built-in support for MapReduce engine.

Not applicable scenario is as follows:

1) require a high degree of transactional systems.

2) traditional business intelligence applications.

3) complex cross-document (Table) cascade query.

【NoSql】

NoSQL (NoSQL = Not Only SQL), which means "not only SQL".

NoSQL advocates the use of non-relational data storage, with respect to the use of relational databases overwhelming, this concept is undoubtedly injected a new thinking.

NoSQL, refers to non-relational database. NoSQL sometimes called Not Only SQL abbreviation for collectively different from traditional relational database management system database.

NoSQL to store very large scale data. (Such as Google or Facebook every day to collect trillion bits of data for their users). These types of data storage does not require a fixed pattern, no extra operation can be extended laterally.

[ Why NoSQL? ]

Today we can through a third party platform: You can easily access and fetch data (such as Google, Facebook, etc.). User's personal information, social network, location, user generated data, and user operation log has increased exponentially. If we want to carry out these user data mining, SQL database that is not suitable for these applications, and the development of NoSQL database well able to deal with these large data.

[Relational database follows the ACID rules]

Services in English is transaction, and the real world of trading is very similar, it has the following four characteristics:

1, A (Atomicity) atomicity

That transaction in the operation, either all done, or what they should not do. There is a transaction fails, the entire transaction fails, and want to roll back.

2, C (Consistency) consistency

To have the database in a consistent state, run the transaction will not change the original database consistency constraints.

3, I (Isolation) independence

The so-called independence means not affect each other between concurrent transactions. If a transaction data to be accessed is being modified by another transaction, as long as the other uncommitted transactions, it accesses data from uncommitted transactions on impact.

4, D (Durability) Persistence

Persistence means that once the transaction commits, modify it made will be permanently stored on the database, it will not be lost even if downtime occurs.

[What is MongoDB?]

MongoDB is written in C ++ language, it is an open source database distributed file system based storage.

In the case of high load, add more nodes, you can ensure server performance.

MongoDB is designed to provide scalable, high-performance data storage solution for WEB applications.

MongoDB the data is stored as a document data structure of the key (key => value) pairs. MongoDB document similar to JSON object. Field value can contain other documents, arrays and array of documents.

SQL term / concept The term & MongoDB / concepts explain
database database database
table collection Database table / collection
row document Data rows / documents
column field Data field / fields
index index index
table joins
Table join, MongoDB does not support
primary key primary key Primary keys, MongoDB automatically _id field as the primary key

Figure-1-Mapping-Table-to-Collection-1.png





Guess you like

Origin blog.51cto.com/13479739/2484035