Mysql (a) SQL and NoSQL

First of all you need to know SQL and NoSQL

SQL (Structured Query Language) database, refers to a relational database. The main representatives: SQL Server, Oracle, MySQL (open source), PostgreSQL (Open Source).

NoSQL (Not Only SQL) refers to non-relational database. The main representatives: MongoDB, Redis, CouchDB.

The difference between SQL and NoSQL

SQL data types Features

1.SQL table to create a strict data template, it is difficult to make mistakes.
2.SQL standardized, multi-table associated with the maximum mode reduces redundant data.
3.SQL multi-table join with a strong association
4.SQL has a foreign key to ensure data integrity
good things 5.SQL support
6.SQL CRUD grammar is standardized declarative language

Nosql type of database features:

1.NoSQL more flexible and tolerant, able to store any data, can cause problems of consistency.
2.NoSQL anti-standardized sacrificing data redundancy to speed up queries, but publishers to update information in multiple records will be significantly slower.
3. Lack of security and integrity of things to protect
4.Nosql json based on simple but complex queries
5.NoSQL data model is often considered easier and faster than SQL;
6.NoSQL data itself on the Cache has done quite a lot of optimization work.

sql data type has the following drawbacks and Nosql do well compensated in this regard
  1. Extended difficulty: Join this because of similar multi-table query mechanism, so that the database is very difficult in the expansion;

  2. Slow to read and write: This situation mainly occurs when the amount of data reaches a certain size due to the logical relational database system is very complex, making it extremely prone to concurrency issues such as deadlocks, resulting in very serious decline in its read and write speeds

  3. High cost: License price enterprise-class database is very alarming, and with the size of the system, and rising;

  4. Limited support capacity: existing relational solution also can not support Google such massive data storage;

SQL is more suitable for the project:

Requires discrete logic 1. The data can be determined in advance
2. Data integrity is essential
3. Have good experience in the development and support of standard technology foundation

More suitable for NoSQL projects:

1. irrelevant, uncertain or changing data requirements
2. easier liberal project object, you can instantly coding
is necessary 3. Speed and scalability

What databases can do?

Store large amounts of data, easy retrieval and access to
consistent data, integrated
sharing and security
through a combination of analysis, generate new useful information

Features Database

Two-dimensional data structure in the storage table.
Transactional atomicity Isolation persistent consistency (referred ACID)
support the SQL language of the data stored therein to operate

Scene 6 applies, database

Scene there is a certain relationship between the data, you need to query the data associated with the
need transaction support business scenarios
require the use of flexible operation data of the SQL language scene

Relational database selection principle

1, is widely used in the database
2, the scalability of the database
3, the security and stability of the database
4, the database system supports
cost 5, the database

Principles of database options

MySQL database scalability
supports replication logical binary log
exists more third-party databases intermediate layer, support and separate read and write sub-library sub-table
MySQL security and stability of the
availability from MySQL replication master cluster can reach 99%
with master-slave replication highly available architecture can achieve 99.99% availability of
support for storing graded security control in the MySQL data
systems supported by MySQL
support Liunx system
supports windows system
cost of MySQL
community edition free
use of large numbers of people, you can easily get technical carried out

Features of non-relational databases

Flexible storage architecture, there is no fixed structure
support for transactions is relatively weak, but high-performance concurrent processing of the data is
mostly not applicable SQL language operating data

Applicable scenario of non-relational databases

Scene data structure is not fixed
to the transaction less demanding, but concurrent read and write relatively large scene
processing operations on relatively simple scenario data

Published 45 original articles · won praise 7 · views 904

Guess you like

Origin blog.csdn.net/qq_42222342/article/details/104045297