NoSQL and relational database

Source: Internet
Author: User
Tags value store

Basic concepts of one or two people

NoSQL, which refers to non-relational databases.

Relational database is a database based on the relational model.

The relational model is mentioned here,

The relational model was proposed by E.f.codd in 1970.

Compared with the level and mesh model, it has the following characteristics:

1. Simple data structure (two-dimensional table)

2. A solid theoretical basis.

A. Relational operation theory

B. Relational model design theory

In simple terms, the relational model refers to a two-dimensional tabular model, and a relational database is a data organization composed of two-dimensional tables and their linkages.

There is no clear scope and definition for NoSQL, but they all have common features:

No predefined schemas are required: You do not need to define the data schema beforehand and predefine the table structure. Each record in the data may have different properties and formatting. When inserting data, it is not necessary to pre-define their patterns.

No shared schema: a fully shared schema in the storage area network relative to all data storage. NoSQL often divides the data and stores it on each local server. Because the performance of reading data from a local disk tends to be better than the performance of reading data over a network, it improves the performance of the system.

Elastic Extensibility: You can dynamically add or delete nodes while the system is running. No maintenance is required and data can be migrated automatically.

Partitioning: Rather than storing data at the same node, a NoSQL database needs to partition the data and spread the records across multiple nodes. It is usually partitioned and replicated at the same time. This improves both parallel performance and guarantees that there is no single point of failure.

Asynchronous replication: Unlike a RAID storage system, replication in NoSQL is often a log-based asynchronous replication. In this way, the data can be written to a node as soon as possible without being delayed by the network transmission. The disadvantage is that consistency is not always guaranteed, and a small amount of data may be lost in the event of a failure.

Base: The strict acid characteristics relative to the transaction (acid, which is 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 guarantees the base feature. Base is the final consistency and soft transaction.

NoSQL databases do not have a unified architecture, the difference between two NoSQL databases, or even far more than two kinds of relational databases. It can be said that NoSQL has its merits, and that successful NoSQL must be particularly useful in certain situations or applications where it is far better than relational databases and other NoSQL.

NoSQL databases in the following cases are relatively applicable: 1, the data model is relatively simple, 2, the need for more flexible IT systems, 3, the database performance requirements are high, 4, does not require a high degree of data consistency, 5, for a given key, more easily map complex values of the environment.

Second, four categories of NoSQL databasesKey value (key-value) store database

This type of database primarily uses a hash table that has a specific key and a pointer to the specific data. The advantage of the Key/value model for IT systems is simplicity and ease of deployment. But if the DBA only queries or updates part of the value, Key/value becomes inefficient. Examples include: Tokyo cabinet/tyrant, Redis, Voldemort, Oracle BDB.

Typical application Scenarios

Content caching, which is used primarily for high-access loads that handle large amounts of data, for some log systems, and so on.

Data model

Key-value pairs that point to value, usually with hash table

Strengths

Fast Search Speed

Weaknesses

Data is unstructured and is usually used only as a string or binary data

The column stores the database.

This part of the database is often used to deal with massive amounts of data for distributed storage. Keys still exist, but they are characterized by pointing to multiple columns. These columns are arranged by the column family. such as: Cassandra, HBase, Riak.

Typical application Scenarios

Distributed File Systems

Data model

To store the same column of data in a clustered type

Strengths

Find Fast, scalable, and easily distributed extensions

Weaknesses

function relative limitation

Document Type Database

The document database is inspired by Lotus Notes Office software and is similar to the first key-value store. 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 query. such as: CouchDB, MongoDb. Domestic also has the document type database SEQUOIADB, already open source.

Typical application Scenarios

Web applications (similar to Key-value, value is structured, but the database is able to understand the contents of value)

Data model

Key-value corresponding key-value pairs, value is structured data

Strengths

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

Weaknesses

Query performance is not high, and the lack of uniform query syntax.

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. such as: neo4j, Infogrid, Infinite Graph.

Typical application Scenarios

Social networks, referral systems, and more. Focus on building a relationship map

Data model

Graph structure

Strengths

Using graph structure correlation algorithm. such as shortest path addressing, N-degree relationship lookup, etc.

Weaknesses

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.

Iii. some problems in existence

While most NoSQL data storage systems have been deployed in real-world applications, there are many challenging questions about the current state of research.

The existing Key-value database products are mostly oriented to specific application self-government, and lack generality.

There are limited features supported by the product (transaction characteristics are not supported), which makes the application have some limitations.

There have been some research results and improved NOSQL data storage systems, but they are the corresponding solutions for different application needs, such as supporting the group transaction characteristics, elastic transactions, and so on, rarely from the global consideration of the generality of the system, nor the formation of a serialized research results;

The lack of strong theories like relational databases (such as the Armstrong Axiom System), technology (such as mature heuristic-based optimization strategies, two-block protocol, etc.), and support for standard specifications such as SQL language.

Currently, the HBase database is one of the most secure NoSQL database products, while other NoSQL databases mostly do not provide built-in security, but as NoSQL develops, more and more people are beginning to realize the importance of security, Some NoSQL products are beginning to provide some security support.

With the development of cloud computing, Internet and other technologies, big data is widely available, and it also presents a lot of new applications in cloud environment, such as social network, mobile service, collaborative editing and so on. These new applications also put forward new requirements for massive data management or cloud data management systems, such as transaction support, System resiliency, and so on. At the same time, the design goals of the massive data management system in cloud computing era are extensibility, elasticity, fault tolerance, self-management and "strong consistency". At present, the system can satisfy the expansibility by supporting the arbitrary increment and decrement of the nodes, the fault tolerance of the system is ensured by the replica policy, and the self-management of the system is realized by the monitoring State message coordination. The goal of "elasticity" is to satisfy the Pay-per-use model to improve the utilization of system resources. The characteristic is imperfect of the typical NoSQL database system, but it is the typical characteristic of the cloud system. "Strong consistency" is mainly the demand of new application.


NoSQL and Relational databases

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.