How much do you know about NoSQL?

Source: Internet
Author: User

What is 1.NoSQL?

NoSQL is not the only SQL abbreviation, meaning "not just SQL" means, refers to the non-relational database. Emphasize the advantages of Key-value stores and documentation databases, rather than simply opposing the RDBMS.

NoSQL products are functional castrated versions of traditional relational databases that significantly improve product performance by reducing the functionality that is less or less used

How is 2.NoSQL produced?

With the development of web2.0 technology, it has led to the rapid development of Internet of things and mobile network. Traditional relational database in coping with web2.0 website, especially the super-large-scale and high-concurrency SNS type web2.0 pure Dynamic Web site has become inadequate, exposing a lot of insurmountable problems, and non-relational database because of its own characteristics have been very rapid development.

NoSQL databases are created to address the challenges of multiple data types in large-scale data sets, especially big data application challenges.

Features of 3.NoSQL:

    1. Mode freedom: NoSQL database is not like the traditional relational database need to define database, data table and other structure can access data, it does not need to do data integrity check when adding and deleting data. Each record in a data table may have different properties and formatting.
    2. Inverse normalization: In order to reduce data redundancy and enhance data consistency, in the design of relational database, it is necessary to follow the paradigm requirement, and the data table must satisfy the third normal form at least. In this way, it is not easy to scale the database horizontally by establishing various associations between the tables, and these connection operations will reduce the query efficiency of the database. And the NoSQL database removes the constraint, relaxes the transaction safeguard, is advantageous to the data distributed storage.
    3. Multi-Partition Storage: Traditional relational databases tend to store data on a single node. This approach is expensive and unsustainable by increasing the performance of the system by adding memory and disk to achieve vertical scaling of the data. NoSQL databases partition data and store it on multiple nodes, which is a horizontal way of scaling, which not only satisfies the storage requirements of big data, but also improves the reading and writing performance of data.
    4. Elastic extensible: NoSQL database can not only store data in partition, but also can change and delete nodes dynamically during system operation, the data automatically balance movement, no manual intervention operation is needed.
    5. Multi-replica asynchronous replication: To ensure data security, NoSQL databases tend to hold multiple copies of the data. In the operation of the time is often to write data quickly to a node, the rest of the node by reading the read and write the log node to achieve asynchronous replication of data
    6. Soft transactions: Transactions are a feature of relational databases. Transactions often involve a series of operations that either do or do not. The transaction satisfies the acid characteristics (acid: the abbreviation for the four basic elements that the database transaction performs correctly. Contains: atomicity (atomicity), consistency (consistency), isolation (isolation), persistence (durability)). The NoSQL database does not fully satisfy the acid characteristics of the transaction, but it can guarantee the final consistency of the transaction. Transaction is the core of the relational database, so many years of development of relational database is because of this core. But now, with the rapid growth of Internet data, business has also put the relational database into a bottleneck.

Basic Theory of 4.NoSQL:

1. Cap Theory:

Three important features in distributed systems: Consistency (Consistency), availability (Availability), Partition fault tolerance (tolerance of network Partition)

  The CAP principle is that these three elements can achieve at most two points at the same time, it is impossible to balance the three. Therefore, in the design of distributed architectures, trade-offs must be made. For distributed Data Systems, partition tolerance is the basic requirement, otherwise it loses its value. So designing a distributed Data system is a balance between consistency and usability. For most Web applications, there is no need for strong consistency, so sacrificing consistency for high availability is the direction of most distributed database products.

  The theory was made by famous American scientists and founder Eric Brewer, a well-known internet company Inktomi, at the 2000 PODC (Symposium on Principles of Distributed Computing) Conference, Later, Seth Gilbert and Nancy Lynch both proved the correctness of the CAP theory.

2. Base model:

  Basically Availble--Basic available

  Soft-state--Soft state/Flexible transaction, state can be out of sync for some time

  Eventual consistency--Final consistency

  

3. Final consistency theory:

Consistency is the consistent data, in a distributed system, it can be understood that the values of data in multiple nodes are consistent.  And consistency can be divided into strong consistency and weak consistency. Strong consistency can be understood as the data in all nodes is the same at any one time. At the same point in time, the value you get to Key1 in Node A is the same as the value you get to Key1 in Node B.
The weak consistency contains many different implementations, and the final consistency is widely implemented in the distributed system at present. The so-called final consistency, is not guaranteed at any time any node on the same data is the same, but with the migration of time, the same data on different nodes always in the direction of convergence changes.  It can also be simply understood that after a period of time, the data between the nodes will eventually reach a consistent state. The best example of eventual consistency is the DNS system, which, because of the implementation of the DNS multi-level cache, does not take effect on all DNS service nodes globally after the DNS server cache expires, and updates new records to the source server after the expiration of the caching of the data.

5. Common NoSQL Database comparisons:

category Examples Example Typical application Scenarios Data Model Advantages Disadvantages
Key value (Key-value) Tokyo cabinet/tyrant, Redis, Voldemort, Oracle Bdb,memcache Content caching, which is used primarily for high-access loads that handle large amounts of data, for some log systems, and so on. Key-value pairs that point to value, usually with hash table Fast Search Speed Data is unstructured and is usually used only as a string or binary data
Column Store Database Cassandra, HBase, riak,bigtable Distributed File System. Store-by-column, with a very large IO advantage for queries on a column or a few columns To store the same column of data in a clustered type Find Fast, scalable, and easily distributed extensions function relative limitation
Document Type Database CouchDB, MongoDb Stores content in a JSON-like format that can be indexed to certain fields, which is the most relational database Key-value corresponding key-value pairs, value is structured data Data structure requirements are not strict, table structure is variable, do not need to be like a relational database need to pre-defined table structure Query performance is not high, and the lack of uniform query syntax.
Graph Database (graph) Neo4j, Infogrid, Infinite Graph Social networks, referral systems, and more. Focus on building relational maps, dealing with a large number of complex, interconnected, and low-structured data, often with fast data changes and frequent queries Graph structure Using graph structure correlation algorithm. such as shortest path addressing, N-degree relationship lookup, etc. Many times need to calculate the entire graph to get the information needed, and this structure is not very good for the distributed cluster scheme.

If you think this blog is helpful to you, please remember to click on "recommend" at the bottom right! , what's The DA ...

Reprint Please specify source: http://www.cnblogs.com/liushaofeng89/p/4954926.html

How much do you know about NoSQL?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.