Tuesday, January 25, 2022

Relational databases

 Relational databases




This type of database is represented by interconnected tables, in which each row represents a record. The name "relational" comes from the relationship of objects in the database.

Let's say you have a student table and a course grade table that includes the course number, grade, and student ID. In this case, each row with grades will be correlated with the student's data.

Relational databases

Relational databases
SQL-like languages ​​are used to query information from relational databases. They have built-in support for the union operation. By themselves, relational databases can index columns to make things easier. An organized database building system allows you to define schemas before data is entered, which speeds up the database and access to information.

NoSQL databases

There is a non-relational database. Unlike relational ones, they do not have a common structured schema for records. Most NoSQL databases contain JSON records. Different records may contain different fields.




Such a group of databases is called NoSQL (Not only SQL - not only SQL). Although most NoSQL databases support SQL, this is not the preferred use case. Consider 4 types of NoSQL databases.

Documentary
The initial unit in this system is a document, each of which is defined as a kind of record - JSON. Depending on the document, its schema, number of fields, and so on may vary. Document databases allow some fields to be indexed to speed up query parsing.



With the help of such databases, it is very easy to process a large amount of information using parallel computing, since all elements in them have no structural or logical connection between them.

columnar
The initial unit of such databases is a table column. Storing new information uses a new column every time, so it's very easy to get the information you need from such a database. The columnar data saving option allows better compression of the content due to its uniformity.

If you need to access several blocks of information at once during the use of the database, then it is best to use columnar databases. Since when searching, they read a column, and not a whole line, as in other types of databases. This speeds up and facilitates the search process.

Key-value
Such databases operate solely on the basis of a key. In them, you can only request a specific key and then get its value.

NoSQL databases

NoSQL databases
In such databases, it is impossible to access several blocks of information at once and obtain data from several rows/columns. For example, you won't be able to select all records with the mention of the city of Moscow at once. Key-value databases have the advantage of having a Time-to-Live (TTL) field that can be set on a per-entry basis and state when they need to be removed from the program database.

These are very fast databases. This is achieved, firstly, due to unique identifiers, and secondly, by storing data in RAM, the path to which is much shorter than to cloud storage.
You need to define unique keys, good identifiers based on data you already know. They are often more expensive than other types of databases because they use RAM.

These databases are primarily used for caching, as they are fast and do not require complex queries. The time to live field helps you get rid of unnecessary files without any help. Such databases can be used for any data that requires fast queries and conforms to the key-value format.

Graph

First of all, such databases were developed to work with graph material, for example, social networks or knowledge networks. They contain nodes that represent database objects and edges that show the relationship between them.

No comments:

Post a Comment

TOP-5 database management systems

  TOP-5 database management systems A database management system (abbreviated as DBMS) is software for creating and working with databases. ...