Home >Database >Mysql Tutorial >What are the differences between relational databases and non-relational databases?

What are the differences between relational databases and non-relational databases?

青灯夜游
青灯夜游Original
2020-11-12 17:00:3655901browse

Difference: Relational data is naturally in tabular format, so it is stored in the rows and columns of data tables; data tables can be stored in association with each other, and data can be easily extracted. Non-relational data is not suitable for storage in rows and columns of data tables, but is grouped together in large chunks; non-relational data is usually stored in data sets, like documents, key-value pairs, or graph structures.

What are the differences between relational databases and non-relational databases?

The difference between relational database and non-relational database

Relational and non-relational database The main difference between relational databases is the way the data is stored. Relational data is naturally tabular and therefore stored in rows and columns of data tables. Data tables can be stored in association with each other and can be easily retrieved. (Recommended tutorial: mysql video tutorial)

In contrast, non-relational data is not suitable for storage in rows and columns of data tables, but is combined in large chunks. Non-relational data is typically stored in datasets, such as documents, key-value pairs, or graph structures. Your data and its characteristics are the primary influencing factors in choosing how to store and retrieve your data.

Relational database

##The most typical data structure of relational database It is a table, a data organization composed of two-dimensional tables and the connections between them.

Advantages:
1. Easy to maintain: they all use table structures with consistent formats;
2. Easy to use: SQL The language is universal and can be used for complex queries;
3. Complex operations: Supports SQL and can be used for very complex queries between one table and multiple tables.
Disadvantages:
1. Poor reading and writing performance, especially high-efficiency reading and writing of massive data;
2. Fixed table structure, slightly less flexible;
3. High concurrent reading and writing Demand, for traditional relational databases, hard disk I/O is a big bottleneck.

Non-relational database

##Non-relational database is not strictly a kind of database, it should be A collection of structured storage methods for data, which can be documents or key-value pairs.

Advantages:

1. Flexible format: the format of stored data can be key, value form, document form, picture form, etc., document form, picture form, etc., flexible use, application There are a wide range of scenarios, while relational databases only support basic types.

2. Fast speed: nosql can use hard disk or random access memory as the carrier, while relational database can only use hard disk;

3. High scalability;
4. Low cost: nosql database deployment is simple and basic All are open source software.

Disadvantages:

1. No sql support is provided, and the learning and use costs are high;

2. No transaction processing;

3. The data structure is relatively complex, and complex queries A little less.

Classification and comparison of non-relational databases:

1, document type

2, key-value type

3, column database
4. Graph database

##More programming For related knowledge, please visit: Programming Video Course

! !

The above is the detailed content of What are the differences between relational databases and non-relational databases?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn