Interviewer: What are the differences between non-relational databases and relational databases, and what are the advantages?

One, relational database

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

advantage:

  • Easy to maintain: all use table structure and consistent format;

  • ​Easy to use: SQL is universal and can be used for complex queries;

  • Complex operation: Supports SQL and can be used for very complex queries between one table and multiple tables.

Disadvantages:

  • The read and write performance is relatively poor, especially the high-efficiency read and write of massive data;

  • Fixed table structure, less flexibility;

  • With high concurrent read and write requirements, hard disk I/O is a big bottleneck for traditional relational databases.

Two, non-relational database

A non-relational database is not strictly a database. It should be a collection of data structured storage methods, which can be documents or key-value pairs.

advantage:

  • Flexible format: The format of the stored data can be key, value, document, picture, etc., document format, picture format, etc., flexible in use and wide application scenarios, while relational databases only support basic types.

  • Fast speed: Nosql can use hard disk or random access memory as a carrier, while relational databases can only use hard disk;

  • High scalability;

-Low cost: Nosql database is easy to deploy and is basically open source software.

Disadvantages:

  • Does not provide sql support, and the cost of learning and use is high;

  • No transaction

  • The data structure is relatively complex, and the complex query is slightly lacking.

Classification and comparison of non-relational databases:

  • Document type
For example CouchDB MongoDb
Typical application scenarios Web application (similar to Key-Value↓Value is structured, the difference is that the database can understand the content of Value)
Data model Key-Value corresponding key-value pair, Value is structured data
Strengths The data structure requirements are not strict, the table structure is variable, and there is no need to pre-define the table structure like a relational database
Weakness The performance of direct inquiry is not high, and it lacks the guide of Lucha Haiji
  • key-value型
For example Redis, Voldemort, Oracle BDB
Typical application scenarios Content caching is mainly used to handle high access loads of large amounts of data, and is also used in some log systems and so on. )
Data model Key points to Value key-value pairs, usually implemented by hash table
Strengths Find fast
Weakness The data is unstructured, and is usually only used as the word “Rongjin” or “Minghua” to justify e.g.
  • Columnar database
For example Cassandra HBase, Riak
Typical application scenarios Distributed file system
Data model Column cluster storage, the same-column data exists
Strengths Fast search speed, strong scalability, and easier distributed expansion
Weakness Relatively limited functions
  • Graph database
For example Neo4J InfoGrid, Infinite Graph
Typical application scenarios Social networks, recommendation systems, etc. Focus on building a relationship graph
Data model Graph structure
Strengths Use graph structure related algorithms. Such as shortest path addressing, N degree relationship search, etc.
Weakness In many cases, it is necessary to perform calculations on the entire graph to get the required information, and this structure is not very good for distributed multi-sheet development guide

The following is a piece of information about software testing in my collection.

These information should be very comprehensive for friends of software testing. Many friends who review this information have also received offers from major manufacturers, and I hope they can help. You, follow my WeChat public account: Programmer Erhei, you can get it directly for free.

If you find it useful, just click on a triple and let more people see it!

Guess you like

Origin blog.csdn.net/m0_53918927/article/details/114839438