In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The following together to understand that MySQL can only be used to do small projects, I believe everyone will benefit a lot after reading, the text in the essence is not much, hope that MySQL can only be used to do small projects? this short content is what you want.
When I was at school, many people had some prejudices against MySQL, which mainly focused on the following aspects:
1. MySQL does not support transactions (in fact, MyISAM has table locks, but it is relatively inefficient)
2. The amount of data stored by MySQL is relatively small, which is suitable for small projects, while large projects still have to go to Oracle, DB2 and so on.
After so many years, I have been based on MySQL in my own development, and I feel it is necessary for me to say a few fair words.
To be fair
The first question.
With regard to the first issue that does not support transactions, there are certain historical reasons. From the beginning of MySQL design, the storage engine is pluggable, allowing companies or individuals to define their own storage engine according to their own needs (of course, ordinary companies or individuals actually do not have this strength). The widely used storage engine developed by MySQL is MyISAM. MyISAM supports table locks, but does not support row locks, so it is less efficient when dealing with high concurrent write operations, and MyISAM does not support foreign keys (although foreign keys are rarely used in actual projects).
But the problem is not unsolved. This makes it necessary to say that InnoDB is another famous storage engine in MySQL.
The InnoDB storage engine was developed by Innobase Oy, a company based in Helsinki, Finland, and the InnoDB storage engine is even older than MySQL.
When InnoDB was first developed, it was developed as a complete database, so the function is very complete. After the development, the founder wanted to sell the database, but did not find a buyer.
Later, after the launch of MySQL2.0, this pluggable storage engine attracted the attention of Heikki Tuuri, the founder of Innobase Oy. After communicating with MySQL, he decided to introduce InnoDB into MySQL as a storage engine. Although MySQL supports InnoDB, it still mainly pushes its own MyISAM.
But InnoDB was so good that in 2006, he successfully attracted the attention of Oracle, and with a big wave of his hand, he bought InnoDB.
MySQL mainly pushed its own MyISAM, and its life was very bleak, and it was finally won by sun with US $1 billion in 2008, which consolidated sun's position as the leader in the open source field, but the cash ability of sun has always been weak, and sun itself was acquired by Oracle in 2009. At that time, I was still in high school. One day when I was having lunch, I saw the CCTV lunchtime news on the TV in the restaurant. I still have some impressions.
After Oracle acquired sun, both InnoDB and MySQL became Oracle products, which made it very easy to integrate, and in later releases, InnoDB gradually became the default storage engine for MySQL. In the latest MySQL8, metadata tables also use InnoDB as the storage engine.
The main features of InnoDB storage engine are as follows:
1. Support transaction
two。 Support for 4 levels of transaction isolation
3. Support for multi-version reading
4. Support for row-level locks
5. Read-write blocking is related to transaction isolation level
6. Support caching, caching both indexes and data
7. The whole table and primary key are stored in Cluster to form a balance tree.
8....
Of course, it does not mean that InnoDB is necessarily good, in actual development, it is still necessary to choose whether to use InnoDB or MyISAM according to the specific scenario.
So the first problem is self-defeating.
The second question
The second question is indeed a hard wound.
If you compare MySQL to Oracle, you must feel a little worse. After all, one is free of charge, and the charge is very expensive. But the problem is not unsolved.
I believe many small friends have heard that many large domestic factories have used MySQL to store data. Large manufacturers use MySQL because they have the ability to develop their own storage engine, small factories generally do not have this strength, can not develop their own storage engine, but Oracle can not afford to use, so what to do?
In recent years, the rise of distributed database middleware can solve this problem very well. In the field of Java, there are many similar tools, such as Sharding-JDBC, MyCat and so on. Through these tools, we can realize database sub-database and sub-table, as well as dynamic expansion of data table, read-write separation, distributed transaction solution and so on. With these tools, the application scenario of MySQL has been greatly improved.
On the other hand, micro-services are popular in recent years, which is not a simple concept. The micro-service architecture divides a large project into many small micro-services, and each micro-service handles a very small part of its own things, which is more in line with the characteristics of human division of labor and cooperation. In the micro-service architecture, our demand for large tables and multi-table federated queries will be reduced, and MySQL will have more opportunities to display its talents.
Therefore, the second problem can also be solved.
As far as I know, Internet companies use MySQL more often, and traditional software companies may prefer databases such as Oracle.
After reading this article, many readers will want to know more about MySQL. If you need more industry information, you can follow our industry information section.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.