Relational and non-relational databases (NOSQL)

Relational and non-relational databases (NOSQL)

Introduction

Relational databases can be queried with SQL statements, and data tables are more complicated.

NOSQL (Not Only SQL) allows some data to be stored using the SQL system, while other data is allowed to be stored using the NOSQL system. The data storage can not require fixed table mode and intermediate data (metadata), and often avoid the use of SQL JOIN operations, usually stored in the form of key-value pairs or documents, there is no coupling between the data, there is generally a level Expandable features.

classification

NOSQL: MongoDB, CouchDB, RethinkDB, DynameDB

SQL: MySQL, Oracle, PostgrSQL, MariaDB, MS SQL

Relational Database

Relational databases follow ACID rules:

A (Atomicity) Atomicity : The operations in the transaction are either not executed or all are executed.

C (Consistency) Consistency : The data in the database must follow the consistency constraints. The operation of the transaction will not change the consistency constraints, such as the name and data type of the table columns.

I (Isolation) independence : transactions will not affect each other, only after a transaction is executed, will eventually have an impact.

D (Durability) Persistence : Once the transaction is submitted, the changes will be permanently stored in the database, even if it is down, there will be no impact.

Non-relational database

CAP theory: a distributed system can not meet the consistency ( Consistency ) , availability ( Availability ) and partitions fault tolerance ( Partition Tolerance ) , while a maximum of two better met.

img

BASE (Basic Available, Soft-state, Eventually Consistent): is the principle that NOSQL databases usually have weak requirements for availability and consistency:

  • Basic Available: Basically available.
  • Soft-state: Soft state / flexible transactions, 'soft sate' can be understood as connectionless, and 'hard state' as connection-oriented.
  • Eventually Consistent: final consistency (also the ultimate purpose of ACID)

Guess you like

Origin www.cnblogs.com/leafs99/p/sql_and_nosql.html