Advantages and disadvantages of relational database and NoSql database

1. Comparison between relational databases and NoSql databases
1. Concurrency support
Relational databases: support concurrency through transactions and locks. In the case of high concurrency, the execution efficiency is low.
NoSql: It breaks the constraints and transactional consistency of the traditional relational database paradigm, so it has high concurrency performance.

2. Storage and query
Relational database: use relational tables to store data, query
NoSql through SQL: distributed database, support massive data, mostly store data in key-value mode, as well as tables/columns, documents, images, objects and more value and other storage methods; there are also various query methods, and the query efficiency is high.

3. Expansion method
Relational database: It mainly improves performance (vertical expansion) by improving hardware configuration and other upward expansion methods.
NoSql: Increase the outward expansion of database nodes (horizontal expansion).

4. Index method
Relational database: B tree, hash, etc.
NoSql: key-value index

5. Application fields
Relational database: general field
NoSql: specific application field, such as a system that requires massive data, high concurrency, high performance, strong scalability, and can tolerate eventual consistency.

2. Types of NoSql databases
are classified by storage type
1. Key-value pairs
represent Redis

2. Table/column storage
Relational data is stored in rows. Column storage is especially suitable for a table with a lot of fields, and we only select some fields from each query. Why, because if we store by row, although we only get a small part of the fields, the system has to read the entire row first, and then pick out the fields we want to return. The returned content is indeed not much, but the performance consumed behind it is quite a lot. Because the data is stored in the page, and the size of the page is fixed, such as usually 8K, 16K, etc., if there are many fields in a row, the number of records contained in a page will be small. In order to find the specified data for us, There are a lot of pages to be returned. If these pages are not in the memory, then they have to be dispatched from the disk. Hehe, the hard disk light is flashing wildly at this time, how can it not be slow!

If stored in columns, this situation is much more comfortable.

What table should use column storage? For example, this table is used to store some indicators of environmental protection, water quality, hydrology and meteorology. Let me go, those indicators are so many that you doubt your life.

The GBase commonly used by Nanjing University in China is a column-stored NOSQL database, which seems to be the case in Tianjin.

3. Documentation
A record is a document. So it is okay to say that it is a key-value pair storage method.
The representative is Mango DB (MongoDb). It's most like a relational database. Use javascript to query, cool.

3. Disadvantages of NoSql
1. Insufficient maturity, a large number of key features to be implemented
2. Limited support for open source database products
3. Insufficient data mining and BI support, many existing systems cannot directly use NoSql
4. NoSql is a new thing, experts and less talented
 

Guess you like

Origin blog.csdn.net/jiangchuan465/article/details/127439087