Traditional Culture Encyclopedia - Traditional stories - What is a database?

What is a database?

A database is a warehouse that organizes, stores and manages data according to the data structure. Databases are usually divided into three types: hierarchical database, network database and relational database. Different data structures are related and organized according to different data structures. At present, the common database models are divided into relational database (SQL) and non-relational database (NoSQL).

Relational database refers to a database that uses relational models to organize data. Simply put, a relational model refers to a two-dimensional table model, and a relational database is a data organization composed of two-dimensional tables and their relationships.

A relationship is a two-dimensional table with the following properties:

Common relational databases:

Advantages and disadvantages of relational database:

The biggest feature of relational database is the consistency of transactions: the traditional reading and writing operations of relational database are transactional and have the characteristics of ACID, which makes relational database can be used in almost all systems that require consistency.

Advantages: easy to understand, easy to use and easy to maintain.

Disadvantages:

1- Data reading and writing must be parsed by sql, resulting in a large amount of data and insufficient reading and writing performance. Hard disk I/O is a big bottleneck.

2- It has a fixed table structure, so it is difficult to expand.

3- Multi-table association query leads to poor performance.

NoSQL data stores do not need a fixed table structure, and there are usually no join operations. It has incomparable performance advantages in accessing big data compared with relational databases.

1- key-value database: you can add, query and delete databases through key. Because this key is used for primary key access, it has high performance and scalability. For IT systems, the advantages lie in simplicity, easy deployment and high concurrency.

2-column storage database: data is stored in a column family, and a column family stores related data that are frequently queried together. For example, we often look up names and ages, not salaries. In this case, the age and name are placed in one column and the salary is placed in another column.

3- document-oriented database: it can be regarded as an upgraded version of the key-value database, allowing key values to be nested between them. Moreover, the query efficiency of document database is higher than that of key-value database. A document-oriented database stores data in the form of documents.