Relational and non-relational databases

Relational and non-relational databases

Non-relational database classification

Due to the shorter natural diversity of non-relational database itself, and the time appears, therefore, do not want a relational database, there are several databases can dominate the landscape, very many non-relational databases, and most of them are open source.

These databases, in fact, most are relatively simple to achieve, in addition to some common, a large part appear for a certain application requirements, therefore, for such applications, with high performance. Depending on a structured approach and the application, it is divided into the following categories:

1) for high-performance concurrent read and write of the key-value database: Main features of key-value database even with high concurrent read and write performance, Redis, Tokyo Cabinet, Flare is representative of such

2) massive document-oriented database for data access: the characteristics of this type of database that can quickly query data in vast amounts of data, typified by MongoDB and CouchDB

3) scalability for distributed database: Database want to solve this kind of problem is the presence of defects in the traditional database scalability, such databases can adapt to changes in the structure of data and increase the amount of data

VS relational database non-relational databases

Most important feature of the relational database is transactional consistency: traditional relational database read and write operations are transactions with the ACID characteristics, this feature makes the relational database system can be used in almost all of the required consistency, as typical of the banking system.

However, in web applications, particularly SNS applications, consistency is not seemed so important, user A and user B to see the content users see the same inconsistencies C content updates can be tolerated, or that two people see friends same time data updates worse then a few seconds can be tolerated, and therefore, the most important feature of the relational database has been useless in here, at least not so important.

Conversely, relational database in order to maintain consistency huge price to pay for its read and write performance is poor, and like microblogging, facebook kind of SNS applications, concurrent reading and writing skills is extremely demanding, relational database has been unable to cope (in terms of reading, in order to overcome the traditional relational database defects and improve performance, are memcache to increase a static web page, and in the SNS, the change is too fast, memchache has lost the plot), therefore, we must use the new one a data structure stored instead of a relational database.

Another feature is its relational database has a fixed table structure, and therefore its scalability poor, while the SNS, the upgrade of the system, increase in functionality, data structure often means a huge change, it is difficult to relational databases cope, a new structured data storage.

Thus, non-relational database came into being, since it is impossible to meet all the new requirements in a structured data storage, therefore, strictly non-relational database is not a database, it should be a structured data storage method set.

Advantages and disadvantages of relational databases

The most typical data structure of a relational database is a table, and a data link between the organization of two-dimensional table consisting of

 

Advantages :

1, easy to maintain: using a table structure is consistent format;

2, easy to use: SQL common language, can be used for complex queries;

3, complex operation: supports SQL, can be used for very complex queries between a table and multiple tables.

Disadvantages :

1, read and write performance is relatively poor, especially efficient mass data read and write;

2, the fixed table structure, hence less flexibility;

3, concurrent read and write high demand, the traditional relational databases, disk I / O is a big bottleneck.

 

Advantages and disadvantages of non-relational databases

Non-relational database strictly not a database, it should be for a collection of structured data storage method, can be a document or key-value pairs.

advantage:

1, flexible format: The format of the stored data can be key, value form, the form of documents, pictures, forms, etc., in the form of documents, pictures, forms, etc., flexible, wide application scenarios, and only supports basic relational database type.

2, speed: nosql random access memory or a hard disk may be used as a carrier, and a hard disk can use the relational database;

3, high scalability;

4, low cost: nosql simple database deployment, basically open source software.

Disadvantages :

1, does not provide support sql, learning and use of high cost;
2, no transaction;
3, the data structure is relatively complex, less impressive aspects of complex queries.

 

reference:

https://blog.csdn.net/ochangwen/article/details/53423301

https://blog.csdn.net/aaronthon/article/details/81714528

Guess you like

Origin www.cnblogs.com/kexinxin/p/11761841.html