Comparison and explanation of NoSQL and RDBMS

Source: Internet
Author: User

Overview

The traditional relational database and data warehouse are becoming more and more incompetent in the face of big data processing. Because the design of a relational database management system (RDBMS) has never considered the ability to handle ever-increasing and well-formed data, and the explosive growth in user demand for data access and analysis. They are generally a fixed schema 缺乏对非结构化数据的支持,同时对数据分片存储、系统扩展性的支持也比较局限,系统的扩容过程也比较复杂 . In addition, many traditional database methods are constructed for long-term strategic analysis rather than real-time decision-making. In this context, NoSQL databases have emerged.

The concept of database schema

The schema in the database is a collection of database objects, and a user typically corresponds to a schema.
The official definition is as follows:
A schema is a collection of the database objects (used by a user.).
Schema objects is the logical structures (logical structure 逻辑概念 ) that directly refer to the database ' s data.
A user is a name, defined in the database, can connect to and Access objects.
Schemas and users Help database administrators manage database security.

Why NoSQL doesn't have a fixed schema.

To store data in a relational database, you must first define a "pattern", which is to explain to the database with a predefined structure: what tables to have, which columns are in the table, and what type of data each column holds. 必须先定义好模式,然后才能存放数据(结构化).

In contrast, the data storage of a NoSQL database is more casual. The "Key value database" can store any data in the name of a "key". The document database is actually the same, because it has no restrictions on the structure of the document being stored. In the column family database, any column can be arbitrarily stored data. You can add a new edge to the graph database, or you can include properties in the nodes and edges.

The proponents of a modeless database enjoy the freedom and flexibility it brings. If you use a pattern, you must specify the data you want to store in advance, but this is tricky. Get rid of the constraints of the model, you can easily store the required data, so we can easily according to the progress of the project to modify the original data storage, once the discovery of new things, just put them into the database is good. In addition, if you find something that is useless, you can no longer store it. In a relational database that uses patterns, if you delete a column, you may have to worry about whether the operation will cause the old data to be lost.

What is data fragmentation?

In a database system, the concept of "Shard" refers to (a shard of data). Each global relationship can be divided into several disjoint parts, each of which is called a fragment.

In NoSQL, Sharding is sharding, which can be simply defined as a partitioning scheme that distributes large databases across multiple physical nodes. Each shard is placed on top of a node.

Why does NoSQL have no fixed query language? Acid and Baseacid

In a database system, transactions have an acid 4 attribute (Jim Gray has a detailed discussion of transactions in transaction processing: Concepts and techniques).

(1) atomicity (atomicity): A transaction is an atomic manipulation unit whose modifications to the data are either all executed or not executed.

(2) Consistency (consistent): data must be in a consistent state at the beginning and completion of a transaction. This means that all relevant data rules must be applied to the modification of the transaction to preserve the integrity of the data; At the end of the transaction, all internal data structures, such as B-tree indexes or doubly linked lists, must also be correct.

(3) Isolation (Isolation): The database system provides a certain isolation mechanism to ensure that transactions are performed in a "stand-alone" environment that is not affected by external concurrency operations. This means that the intermediate state in the transaction process is not visible to the outside, and vice versa.

(4) Persistence (durable): After a transaction is complete, it changes the data to be permanent, even if a system failure occurs.

For transactions of a single node, the database is guaranteed the acid characteristics of the transaction through concurrency control (two-phase blocking, phase-locking or multiple-version, multiversioning) and recovery Mechanisms (log technology). For distributed transactions that span multiple nodes, the acid of the transaction is guaranteed through a two-phase commit protocol (phase commiting).

It can be said that the database system is accompanied by the needs of the financial industry and rapid development. For the financial industry, usability and performance are not the most important, and consistency is the most important, the user can tolerate system failure and stop the service, but can not tolerate the money on the account for no reason to reduce (of course, without undue increase is possible). And strong consistency of affairs is the fundamental guarantee of all this.

BASE

Based on the practice of e-commerce in the Internet, it evolves from the cap theory, and the core idea is that even if strong consistency (strong consistency) is not achieved, the final consistency can be achieved according to the application characteristics (eventual Consistency) effect. Base is a shorthand for the three phrases of basically Available, Soft state, eventually consistent, and is an extension of C & A in the cap. The meaning of base:

(1) Basically Available: basic available;

(2) Soft-state: Soft state/flexible transaction, that is, the state can have a period of time of the different steps;

(3) Eventual consistency: final consistency;

Base is anti-acid, which is completely different from the acid model, sacrificing strong consistency, obtaining basic availability and flexible reliability, and requiring eventual consistency.

Comparison and explanation of NoSQL and RDBMS

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.