NoSQL Basic Learning
The first nosql to learn recently is MongoDB, in order to understand the basics of nosql, to summarize, mainly to learn the theory of NoSQL
I. Introduction (INTRODUCTION)
It is the abbreviation of "not only SQL", non-relational database, it has very good versatility and very high performance, it has the advantage in processing a large amount of data.
The advent of 1.NoSql is relative to the traditional relational database, with the emphasis on what the wiki says:
NoSQL is the system of database management systems that are different from the traditional relational repositories.
There are many distinct differences between the two, the most important of which is that NoSQL does not use SQL as a search language. The storage can be stored without the need for a fixed tabular pattern, and often avoids the use of SQL join operations, typically with horizontal extensibility features.
So what is the point of its emergence? The answer is that, as modern computing systems generate huge amounts of data on a daily basis, and NoSQL is a product of modern computer science, at least I think, of course,NoSQL is a new revolutionary movement in the database, and early on, there was a growing trend towards the 2009. NoSQL advocates are advocating the use of non-relational data storage, which is undoubtedly an entirely new way of thinking, compared to the overwhelming use of relational databases, and in the final analysis, the NoSQL system is the distributed system.
This is a new kind of thinking, like learning algorithms, learning NoSQL, of course, to learn its characteristics, it is very important, as the relational database follows the acid rules, and NoSQL follows the base rules, many of the data in the introduction of NoSQL, will inevitably be compared to NoSQL There's no exception.
2. History of development
The term NoSQL first appeared in 1998 and is a lightweight, open source, relational database that does not provide SQL functionality developed by Carlo Strozzi.
In 2009, Last.fm's Johan Oskarsson launched a discussion on the distributed open source database, and Eric Evans from Rackspace again proposed the concept of NoSQL, when NoSQL mainly refers to non-relational, distributed, does not provide an acid database design pattern.
The No:sql (East) symposium, held in Atlanta in 2009, was a milestone with the slogan "Select Fun, Profit from Real_world where Relational=false;". Thus, the most common explanation for NoSQL is "non-relational", emphasizing the advantages of Key-value stores and documentation databases, rather than simply opposing RDBMS.
Based on 2014 years of revenue, the NoSQL market leader is Marklogic,mongodb and DataStax. Based on the 2015 popularity rankings, the most popular NoSQL database is Mongodb,apache Cassandra and Redis.
Two. Feature (features)
NoSQL system is a distributed system, distributed system is built on the network of software systems, with a high degree of transparency, in the distributed database system, the user is not feeling the data is distributed, as if the operation is a unified whole, that is, users do not have to know whether the relationship is split, there is no copy, The database on which machine and operation is performed on which machine, it is not known that the internal work needs to be done by many machines.
1.CAP theorem (Cap principle in distributed areas)
The cap principle, also known as the cap theorem, refers to a distributed system:
- Consistency (strong consistency), data consistent update, all data changes are synchronized, after the update, all nodes have the same data at the same time
- Availability (availability), fast response performance, ensuring every request responds with success or failure
- Partition tolerance (partition fault tolerance), that is, reliability, or a node in the system error, does not affect the continued operation of the system
Theorem: Any distributed system can only meet the two points at the same time, not to do three, this theory in the distributed storage system, can only achieve the above two points
2.BASE thinking (completely different from acid thinking, sacrificing high consistency, availability or reliability)
Base idea (or base model), base is basically Available (basic available), Soft State (soft status/Flexible transaction) and eventually consistent (final consistency) abbreviation:
- Basically Available (basic available), support partition failure (e.g.sharding fragmentation database)
- Soft State (soft state/flexible transaction), status can be unsynchronized for a period of time, asynchronous
- Eventually consistent (final consistency), the final data is consistent, and not always high consistent
Theorem: The main emphasis on basic usability, that is, if the pursuit of high performance, then it is necessary to sacrifice consistency or fault tolerance, in short, base thinking is the consistency of the CAP principle and usability tradeoff between the results
The CAP principle is the basis of a NoSQL database, so keep this base idea and the CAP principle in mind!!!!
3. The relationship with NoSQL
Now that NoSQL enriches the base idea and can tailor it to specific scenarios, the acid principle of relational databases, NoSQL systems typically focus on performance and extensibility, rather than on the transaction mechanism in acid, where transactions require consistency
Three. NoSQL Database classification
The database is divided into four categories:
- Key value (key-value) store database
- Column Store Database
- Document Type Database
- Graph Database (graph)
1. Key value (key-value) Storage database
A database of data stored in a key-value pair, like a Java map, with a unique value for each key, representing the
2. Columnstore Database
is often used to deal with distributed storage of large amounts of data, is a column-related storage architecture of data storage database, mainly for batch data processing and instant query
3. Document-based database
This type of data model is a versioned document, and semi-structured documents are stored in a specific format, such as JSON. A document database can be considered an upgraded version of a key-value database, allowing for the nesting of key values. and the document database is more efficient than the key-value database.
4. Graph Database (graph)
The graphical structure of the database is different from the other columns and the rigid structure of the SQL database, it is using a flexible graphical model, and can be extended to multiple servers. NoSQL databases do not have a standard query language (SQL), so database queries require a data model. Many NoSQL databases have rest-type data interfaces or query APIs
NoSQL Basic Learning