Types of databases and which is better SQL or NoSQL?

Giteqa

Introduction

In the modern world, data plays an important role in human life. Every day we receive some information, for example, the name of a new colleague, his age or where he comes from. All this information can be considered useful and it is better to know it, but it is not always possible to remember the data that you received.
In this case, you can open a notebook and enter what you are afraid to forget, this very notebook will be the database.
You have already received the answer to the question why databases are needed, so let's figure out what databases there are in the IT field.

Databases in the modern world

At the moment, anyone can work with databases, for this he only needs the desire to learn and the Internet, but if you want your databases to be safe, it is better to leave this matter to database management engineers.
How do engineers manage databases? To help them comes a DBMS (Database Management System) - software that allows you to interact with databases (for example, MySQL).

Database Types

Below are examples of various databases that are used in the modern world. It is impossible to choose one specific one and call it the best at the moment because each has its own advantages and some are convenient in some cases and others in others, read about it below.

Relational databases (SQL)

This type of database can include MySQL, Oracle, etc. This type of database stores information in the form of linked tables where each row of the table is a record. This database is very actively used by many users around the world and is considered one of the best, many game servers and other things work on its basis. It has SQL support and allows you to find data faster thanks to indexing.

Positive

  • Meets ACID requirements
  • They have a simple structure
  • They use SQL and allow you to quickly update data

Minuses

  • It can take a long time to execute a query because each query refers to a table and the larger the table, the longer it takes to wait for a response.
  • Does not support OOP-based objects
  • Less amenable to scalability


NoSQL (Not just SQL) or just non-relational databases

Databases of this type do not have a structured schema for writing data, and most databases contain json records. The database data is divided into several types, I will specify only two of them.

Key-Value

Such databases do not support normal queries between different record values. Here everything works as follows: you request a key and get its value, an example of such a database can be considered Redis.

Graph

In this database, data is stored in the form of graphs and they are very flexible with a clear structure. Databases of this type are often used in social networks. An example of this database can be considered OrientDB or InfiniteGraph

Positive

  • Easy to achieve scalability
  • Speed of work
  • Storing data in different structures

Minuses

  • They are updated for a long time because the information can be stored on different servers
  • Does not match ACID

Conclusion

It is impossible to say exactly what is best to use in one case or another, it all depends on the needs of each user. In order to find out exactly which one is more suitable for your needs, it is better to listen to the opinions of other users and their experience. Also, you can always answer a few questions that will help you understand which database is best to use.

  • Is there a need to read or write data online?
  • What amount of information are you going to store?
  • Is there a need to use columns?
  • Do I need to follow ACID principles?

I would like to note that it is best to use both versions of the SQL and NoSQL databases. It's just that each of these databases can be used for a separate project, because somewhere relational databases with a tabular version are needed where they will be easier to edit, and somewhere speed is more important and then NoSQL should be used.