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

What is MyCat?

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly explains "what is MyCat". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is MyCat".

1. Introduction to MyCat 1. What is MyCat?

   MyCat is the most popular database middleware based on java language. It is a server that implements MySQL protocol. Front-end users can regard it as a database agent, which can be accessed by MySQL client tools and command line. The back-end can use MySQL native protocol to communicate with multiple MySQL servers, and can also use JDBC protocol to communicate with most mainstream database servers. Its core function is to divide databases and tables. Read-write separation can also be achieved with the master-slave mode of the database.

   MyCat is developed based on Ali's open source Cobar products. The stability, reliability, excellent architecture and performance of Cobar and many mature use cases make MyCat very powerful.

With the development of the current version,    MyCat is no longer a simple MySQL proxy. Its back-end can support mainstream databases such as MySQL, SQL Server, Oracle, DB2, PostgreSQL, and so on. It also supports MongoDB, a new type of NoSQL storage, and will support more types of storage in the future. In the view of end-users, no matter what kind of storage method, in MyCat, it is a traditional database table, which supports standard SQL statements for data operation. In this way, for the front-end business system, it can greatly reduce the difficulty of development and improve the speed of development.

   MyCat official website: http://www.mycat.io/

2. The structure of MyCat

3. Benefits of using MyCat 3.1 data magnitude

   single MySQL has limited data storage and operation.

   Mycat can manage several MySQL databases and realize data storage and operation at the same time.

3.2 Open source nature

Mycat is the middleware written by java. Open source, free.

There are a lot of people and organizations who develop, maintain, manage and update Mycat.

The Mycat version has been upgraded rapidly and can follow the development of the environment. If there is a problem, it can be solved quickly.

Mycat has an open source website and an open source community. And there are official e-books.

Mycat is the transformation of Ali's original application of corba.

3.3 Market Application

   MyCat accounts for a very high proportion of Internet applications.

Second, the introduction of concepts in MyCat. Segmentation

Logical syncopation of   . At the physical level, it uses multi-library [database] and multi-table [table] to achieve segmentation.

1.1 Longitudinal / vertical syncopation

   is to store data originally stored in one library to multiple libraries.

Because    reads and writes to the database all operate on the same library, so a single database can not solve the problem of large-scale concurrent writes. For example, we will set up definition database workDB, commodity database payDB, user database userDB, log database logDB, etc., which are used to store project data definition table, commodity definition table, user data table, log data table and so on.

Advantages

Reduce the impact of locks on queries when incremental data is written.

Due to the decrease in the number of single tables and the reduction of records to be scanned in common query operations, the number of retrieval rows needed for a single query of a single table is reduced, the disk IO is reduced, and the latency is shortened.

Disadvantages: unable to solve the problem that the amount of data in a single table is too large.

1.2 horizontal / horizontal syncopation

   stores data that was originally stored in one table in blocks on multiple tables.

   when the amount of data in a table is too large, we can divide the data of the table according to some rules, and then store it to multiple tables with the same structure and different libraries. For example, if there is a large amount of data in the userTable in our userDB, then we can split the userDB into multiple userDB:part0DB, part1DB, etc., with the same structure, and then cut the userTable on the userDB into many userTable:userTable0, userTable1, etc., and then store these tables on multiple userDB according to certain rules.

Advantages

The concurrency ability of a single table has been improved, and so has the performance of disk IZP O.

If there is high concurrency, the total table can divide the concurrency pressure into different small tables according to different queries.

Disadvantage: unable to implement table join query.

two。 Logical Library-Schema

Database. Database defined in    Mycat. It exists logically. But physically it does not exist. It is mainly aimed at the concept of vertical segmentation.

3. Logical table-table

Table. Table defined in    Mycat. It exists logically, but not physically. It is mainly aimed at the concept of horizontal segmentation.

4. The default port applies port MySQL3306Mycat8066tomcat8080Oracle1521nginx80http80redis63795. Data host-dataHost

The host address where the    physical MySQL is stored. You can use hostname, IP, domain name definition.

6. Data Node-dataNode

   configures physical database. The physical node in which the data is saved. It's database.

7. Fragmentation rule

When    controls data, how to access physical database and table. Is the algorithm to access dataHost and dataNode. When Mycat deals with specific data CRUD, how to access the algorithm of dataHost and dataNode. Such as: hash algorithm, crc32 algorithm and so on.

Thank you for your reading, the above is the content of "what is MyCat", after the study of this article, I believe you have a deeper understanding of what is MyCat, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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