Oracle

Oracle is not the most popular database, but it is the most famous one. Although it can be argued that the most popular. See how to count . If you just look at the number of companies, then MySQL is the most popular database: it's pretty good and completely free :)

But it can also be considered differently. If there is one company with a million customers that uses Oracle and 5 companies with a hundred customers that use MySQL, then Oracle has a million customers and MySQL only 500 people.

In general, if you take large companies that have money and look at which DBMS they choose, then about a third of all companies in the world are sitting on Oracle. Something like this.

As a programmer, you are more likely to work in the future on Oracle than on MySQL. There is an excellent video on the Internet that demonstrates how the popularity of DBMS has changed over the past 20 years.

MySQL

The second most popular among all DBMS is MySQL. And it is the first in popularity among all free DBMS. Now you understand why we learn SQL from her example. Hype is hype, and business is quite conservative in the choice of infrastructure.

In principle, we have already talked about MySQL. Once they were bought by Sun , then by Oracle . Which, well, it is very difficult to call a corporation of goodness.

It is they who, after the acquisition of Sun, are constantly trying to make Java paid.

Yes, Sun owned both Java and MySQL before Oracle bought them.

This fact and the reputation of Oracle scared the MySQL developers a little, who decided to fork the MySQL project and call it MariaDB.

MariaDB is actually a clone of MySQL with some implementation quirks that allow you to get around the nuances of patents and licenses.

However, Oracle is also not fools. To prevent customers and developers from leaking to MariaDB, Oracle continues to fund the development and development of MySQL, which continues to be free.

And to sit on two chairs, a paid MySQL Enterprise was released for corporate clients , which is no different from MySQL Community Edition , but whose licenses are better suited for business.

PostgreSQL

Another interesting DBMS is PostgreSQL (pronounced "postgres cue").

This is another free DBMS that has been gaining popularity very quickly in recent years. Although it is still far from MySQL.

PostgreSQL is primarily focused on distributed work. Its strengths are:

  • High-performance and reliable transaction and replication mechanisms
  • Extensible system of built-in programming languages: PL SQL, PL JS, PL Python, …
  • Table inheritance
  • Ability to index geometric (in particular, geographical) objects
  • Built-in support for semi-structured data in JSON format with the ability to index them
  • Extensibility (the ability to create new data types, index types, programming languages, extension modules, connect any external data sources)

Do you know why it's called that? Here is how it was…

About 50 years ago, in the early 70s, the University of Berkeley began to develop its own relational DBMS and called it Ingres .

In the early 80s, Professor Michael Stonebreaker left the project and decided to write his own DBMS with blackjack and courtesans. He and his students started writing their own DBMS, which they called simply Post Ingres , shortened to Postgres in the future .

And since the name Postgres did not mean anything to anyone, it was decided to add the SQL suffix to it. This is how PostgreSQL turned out, which immediately lost the double S, and began to be written as PostgreSQL. But you say the name, you need to read it like PostgresQL.

NoSQL

If you are interested in databases, then you have definitely heard about NoSQL databases . I hasten to upset you: NoSQL is purely a marketing name , and SQL is there. He's just truncated.

What does it look like? Imagine a nice web page written in HTML, CSS and JavaScript... that was opened in a 1995 browser. It works on the strength of 10% of CSS and does not support JavaScript at all. And this new stripped-down standard is called… NoHtml .

For example, JOINs between tables may not be supported in NoSQL, and then you have to either emulate this at the level of Java code in the program, or store all the data of related tables in one huge table.

And if in the case of NoHtml, we seem to have rolled back 20 years ago, then in the case of NoSQL, the rollback occurs somewhere around 40 years.

Take, for example, the Cassandra NoSQL database that Facebook uses to store the data of billions of users. Actually, they developed it and then posted it as an OpenSource project.

Let's start with the most interesting - all the DBMS code is written in Java . The C++ code would probably run faster, but there would be more bugs. And Java code is easier to maintain and develop.

The general format of requests to the Casandra DBMS looks very familiar:

  SELECT columns  
  FROM table 
  WHERE condition
  GROUP BY columns 
  ORDER BY sorting 
  LIMIT quantity

As you can see, SQL is there. Do you know what's missing here? JOIN ! You can only select data from one table :)

Here is a quote from the official documentation:

You cannot perform joins in Cassandra . If you have designed a data model and find that you need something like a join, you'll have to either do the work on the client side , or create a denormalized second table that represents the join results for you.