Database Acid,sql and NoSQL

Source: Internet
Author: User

transactions in the database (transaction) have ACID4 basic features that can be compared to trading:

1,A (atomicity) atomicity

Everything in the transaction is either completed or failed during execution and is rolled back.

2,C (consistency) Consistency

The database should be in a consistent state.

For example: Existing integrity constraints a+b=10, if a transaction changes A, then B must be changed

3,I (isolation) Independence

The concurrent transactions do not affect each other.

If the data to be accessed by one transaction is being modified by another transaction, the data it accesses is not affected by uncommitted data as long as another transaction is not committed.

4,D (durability) Persistence

Once a transaction is committed, the changes are permanently stored on the database

Some of the differences between SQL (structured query Language, Structured Query language) and NoSQL (not-only SQL, referring to non-relational databases):

First, the most important difference is that NoSQL does not use SQL as the query language, and data storage does not require a fixed tabular pattern .

Avoid join operations with SQL, which can be scaled horizontally.

Typical representative of SQL database: SQL Server,oracle,my SQL

Typical representative of a NoSQL database: Mongodb,redis

1. SQL data exists in a specific structure of the table, NoSQL flexible, storage can be JSON, hash table and other ways

2. The table and field structure must be defined in SQL before data can be added;

3. When you need to correlate external data, SQL often requires foreign keys to build a table; NoSQL can put external data directly in the original data set

A join can be used in 4.SQL to query data from multiple relational data tables at once, and NoSQL does not support that usage

5.SQL data coupling is strong, can not delete external used data; NoSQL has no concept of data coupling and can be arbitrarily deleted

There is no concept of transaction in 6.NoSQL, and each operation is atomic

Database Acid,sql and 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.