Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Which is better, MYSQL or PostgreSQL

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail which is better about MYSQL or PostgreSQL. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

From the very beginning, the foreign companies that use MYSQL and PG are divided.

The PostgreSQL camp has the following companies

Apple IMDB Macworld, Debian Fujitsu, Red Hat, Sun Microsystem

Cisco, Skype (please do not doubt whether there is still time for Sun Microsystem and this English article, I have already checked it)

There are some companies here in MySQL

GitHub, NASA, Facebook, Twitter, YouTube, Tesla

From the comparison of companies using different databases on both sides above, it is clear that most traditional companies choose PostgreSQL, and most Internet-like companies use MySQL.

After such opening remarks, the article begins to explain the differences between the two databases from the structure of the database.

PG is defined as an object-relational database management system (ORDBMS), which emphasizes extensibility and standards compliance, supports transactionality, has updatable and materialized views, triggers, and foreign keys, and supports databases of functions and stored procedures. At the same time, it is emphasized that after POSTGRESQL has some of the following functions, it also supports the functions of NOSQL, and can be put on the table.

MYSQL is defined as a relational database management system (RDBMS), which also supports transactions, views, triggers, foreign keys, functional stored procedures and popular open source databases for NOSQL since MYSQL 5.7,

Anyway, when I saw this, I didn't see the tendency in the information I read, or I could see which company's X article at the beginning.

At the bottom of the article, there are various comparisons from the following aspects

1 types supported by the index

2 the supporting mode of data replication

3 the standard form of database syntax

4 data engine aspect

Here, in terms of index types, it is mentioned that PG supports many index types, and there are also two modes of data replication. MYSQL has actually begun to support two replication modes so far (but you have upgraded to MYSQL 8.017), as well as the strict syntax of PG. In the database engine layer, it is not mentioned much, in fact, each has its own strengths, but also has its own weaknesses, not to mention here, different opinions.

Of course, the article is fair in the end, but in the end, I don't forget to say that PG is becoming more and more popular and some features are better than MYSQL.

Of course, this text is not for everyone to abandon and use which one after reading it. I think it is irresponsible and kindergarten behavior.

From the beginning, we can see that if you are a traditional enterprise, or if your business logic is complex, the first choice for some companies at the database level may be POSTGRESQL, because so far, you have rarely heard of complex stored procedures, functions, and SQL like ORACLE to be loaded into MYSQL. Of course, you can use programs to implement them. I don't want to talk about the program layer today, and it's not my strong point that makes the text more verbose. Internet enterprises may generally because of simple business, and need some more flexible architecture, and the development of LEVEL is also relatively high, on the basis of these, generally choose MYSQL as the basic database for a variety of sub-libraries.

And from my recent use of the two databases, I also feel some differences that are not mentioned in the article, such as the developer is asking me

When I design this table, what should I pay attention to when designing the primary key? if it is MYSQL, I will seriously tell them some things that need to be paid attention to in the design of MYSQL primary key, while if it is POSTGRESQL, then I will hold a more open attitude and basically will not have any special requirements. (this is, of course, the difference between index organization tables and VS heap tables.) from a design point of view, POSTGRESQL may be more friendly to developers. Junior designers will not cause too much trouble even if they do not design a special NICE, while MYSQL needs designers who will require more at the beginning (many years of experience in ORACLE table design may not be particularly useful). For example, whether we should be strict with the paradigm (of course not), and which point of view to design the table.

Of course, from a first-come-first-served point of view, MYSQL occupies the top spot at present, and in the domestic situation of going to ORACLE, it can occupy more shares. But some companies originally used the traditional database well, but as soon as they switched to MYSQL, they began to have problems. It is true that the level of developers is not good enough, Tao Hang is not deep enough, and they still use the old way to design, resulting in MYSQL tables filled with a large number of trigger, procedure, foreign keys, such designed things. The original SQL of all kinds of ORACLE is copied to MYSQL. It's not that I haven't seen it before. It's a mess. Finally, I give MYSQL a very bad comment. This is unfair to MYSQL, because you don't understand him.

In other words, the reason why POSTGRESQL demand appears more and more frequently in job advertisements is also that some enterprises have suffered, on the basis of not having the use of MYSQL, and finally a kind of return after various failures.

In fact, in the open source database industry, the traditional database is nothing more than MYSQL VS POSTGRESQL that database is better, this topic might as well be changed to, which is more suitable for you, such a topic is more mature.

For example, your developers have never used MYSQL databases, and they are not trained by Internet enterprises (large or medium-sized factories). Basically, developers who use ORACLE all the time, you might as well let him feel at ease to use POSTGRESQL, at least your project will not have all kinds of weird designs for MYSQL, or enterprises that have been maintaining traditional databases like ORACLE SQL SERVER, don't bother to catch up with MYSQL. First ask how to withstand the pressure of Internet companies and the speed of all kinds of trampling holes and filling holes.

This is the end of the article on "which is better, MYSQL or PostgreSQL". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report